首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装带有本机扩展Gem::Ext::BuildError: ERROR: Failed的puma 5.6.2

安装带有本机扩展Gem::Ext::BuildError: ERROR: Failed的puma 5.6.2
EN

Stack Overflow用户
提问于 2022-03-07 15:20:00
回答 1查看 3.3K关注 0票数 2

Ruby3.1.0

Rails 7.0.2.2 (带有捆绑和Postgresql)

在运行bundle安装时,我一直在puma 5.6.2上出现这种奇怪的崩溃。

代码语言:javascript
复制
% bundle install           
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using rake 13.0.6
Using racc 1.6.0
Using crass 1.0.6
Using minitest 5.15.0
Using builder 3.2.4
Using digest 3.1.0
Using rack 2.2.3
Using io-wait 0.2.1
Using concurrent-ruby 1.1.9
Using websocket-extensions 0.1.5
Using marcel 1.0.2
Using mini_mime 1.1.2
Using bundler 2.3.3
Using timeout 0.2.0
Using nio4r 2.5.8
Using strscan 3.0.1
Using bindex 0.8.1
Using public_suffix 4.0.6
Using thor 1.2.1
Using erubi 1.10.0
Using matrix 0.4.2
Using regexp_parser 2.2.1
Using childprocess 4.1.0
Using method_source 1.0.0
Using redis 4.6.0
Using zeitwerk 2.5.4
Using io-console 0.5.11
Using diff-lcs 1.5.0
Using ffaker 2.20.0
Using pg 1.3.3
Using msgpack 1.4.5
Using rexml 3.2.5
Using rspec-support 3.11.0
Using rubyzip 2.3.2
Using net-protocol 0.1.2
Using rack-test 1.1.0
Using i18n 1.10.0
Using tzinfo 2.0.4
Using reline 0.3.1
Using sprockets 4.0.3
Using mail 2.7.1
Using nokogiri 1.13.3 (arm64-darwin)
Using rspec-mocks 3.11.0
Using websocket-driver 0.7.5
Using bootsnap 1.10.3
Using net-pop 0.1.1
Fetching puma 5.6.2
Using rspec-expectations 3.11.0
Using irb 1.4.1
Using net-imap 0.2.3
Using loofah 2.14.0
Using net-smtp 0.3.1
Using debug 1.4.0
Using rails-html-sanitizer 1.4.2
Using selenium-webdriver 4.1.0
Using rspec-core 3.11.0
Using xpath 3.2.0
Using webdrivers 5.0.0
Using addressable 2.8.0
Using activesupport 7.0.2.2
Using rails-dom-testing 2.0.3
Using globalid 1.0.0
Using activemodel 7.0.2.2
Using capybara 3.36.0
Using activerecord 7.0.2.2
Using factory_bot 6.2.0
Using actionview 7.0.2.2
Using activejob 7.0.2.2
Using actionpack 7.0.2.2
Using jbuilder 2.11.5
Using actioncable 7.0.2.2
Using activestorage 7.0.2.2
Using actionmailer 7.0.2.2
Using actionmailbox 7.0.2.2
Using railties 7.0.2.2
Using actiontext 7.0.2.2
Using sprockets-rails 3.4.2
Using turbo-rails 1.0.1
Using cssbundling-rails 1.1.0
Using rails 7.0.2.2
Using jsbundling-rails 1.0.2
Using rspec-rails 5.1.1
Using stimulus-rails 1.0.4
Using web-console 4.2.0
Using factory_bot_rails 6.2.0
Installing puma 5.6.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/jason/.rvm/gems/ruby-3.1.0/gems/puma-5.6.2/ext/puma_http11
/Users/jason/.rvm/rubies/ruby-3.1.0/bin/ruby -I /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0 -r
./siteconf20220307-61890-nqajx8.rb extconf.rb --with-cflags\=-Wno-error\=implicit-function-declaration
checking for BIO_read() in -lcrypto... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/jason/.rvm/rubies/ruby-3.1.0/bin/$(RUBY_BASE_NAME)
    --with-puma_http11-dir
    --without-puma_http11-dir
    --with-puma_http11-include
    --without-puma_http11-include=${puma_http11-dir}/include
    --with-puma_http11-lib
    --without-puma_http11-lib=${puma_http11-dir}/lib
    --with-openssl-dir
    --without-openssl-dir
    --with-openssl-include
    --without-openssl-include=${openssl-dir}/include
    --with-openssl-lib
    --without-openssl-lib=${openssl-dir}/lib
    --with-openssl-config
    --without-openssl-config
    --with-pkg-config
    --without-pkg-config
    --with-crypto-dir
    --without-crypto-dir
    --with-crypto-include
    --without-crypto-include=${crypto-dir}/include
    --with-crypto-lib
    --without-crypto-lib=${crypto-dir}/lib
    --with-cryptolib
    --without-cryptolib
/Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable
file. (RuntimeError)
You have to install development tools first.
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:591:in `try_link0'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:609:in `try_link'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:830:in `try_func'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:1065:in `block in have_library'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:1007:in `block in checking_for'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:332:in `open'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:332:in `open'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:1006:in `checking_for'
    from /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/mkmf.rb:1060:in `have_library'
    from extconf.rb:17:in `block in <main>'
    from extconf.rb:17:in `each'
    from extconf.rb:17:in `find'
    from extconf.rb:17:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/jason/.rvm/gems/ruby-3.1.0/extensions/arm64-darwin-20/3.1.0/puma-5.6.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/jason/.rvm/gems/ruby-3.1.0/gems/puma-5.6.2 for inspection.
Results logged to /Users/jason/.rvm/gems/ruby-3.1.0/extensions/arm64-darwin-20/3.1.0/puma-5.6.2/gem_make.out

  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in `run'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tempfile.rb:317:in `open'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in `build'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in `build_extension'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in `block in build_extensions'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `each'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `build_extensions'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/rubygems/installer.rb:847:in `build_extensions'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/source/rubygems.rb:204:in `install'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:in `install'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:in `do_install'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/worker.rb:62:in `apply_func'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/worker.rb:57:in `block in process_queue'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/worker.rb:54:in `loop'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/worker.rb:54:in `process_queue'
  /Users/jason/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/bundler/worker.rb:91:in `block (2 levels) in create_threads'

An error occurred while installing puma (5.6.2), and Bundler cannot continue.

In Gemfile:
  puma

我已经试过xcode-select --install了,但这不能解决问题

我在下面的答案中有修复,但是有人能解释一下它在做什么,为什么强迫从rubygems源代码安装似乎解决了这个问题?

EN

回答 1

Stack Overflow用户

发布于 2022-03-07 15:22:13

解决方法是从源代码中安装它。

虽然消息说xcode选择工具丢失了,但这并不是问题所在。

gem install puma -v '5.6.2' --source 'https://rubygems.org/'

一旦我这样做了,我就可以成功地重新运行bundle install

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71383295

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档