OS: Mac Mojave 10.14.6
Rails 5.2.3
Ruby 2.6.3
Я сгенерировал новое приложение и пытался сделать
bundle install
, который был прерван следующим сообщением об ошибке:
Fetching nio4r 2.5.2
Installing nio4r 2.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r
/Users/johndoe/.rbenv/versions/2.6.3/bin/ruby -I /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0 -r ./siteconf20190924-11373-sf54p6.rb extconf.rb --with-cflags\=-std\=c99
checking for unistd.h... *** 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/johndoe/.rbenv/versions/2.6.3/bin/$(RUBY_BASE_NAME)
/Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:601:in `try_cpp'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
from extconf.rb:14:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0-static/nio4r-2.5.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2 for inspection.
Results logged to /Users/johndoe/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0-static/nio4r-2.5.2/gem_make.out
An error occurred while installing nio4r (2.5.2), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.5.2' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rails was resolved to 5.2.3, which depends on
actioncable was resolved to 5.2.3, which depends on
nio4r
Я посмотрел вокруг ипопробовал некоторые из предложений, таких как
bundle config build.nio4r --with-cflags="-std=c99"
bundle
, но это не сработало.Есть идеи?
РЕДАКТИРОВАТЬ:
Это работало нормально, с моим существующим проектом, но он заметил, что он перестал работать вчера, когда я сделал:
bundle update
Я получил ту же ошибку.Если я добавлю:
bundle install
, когда я добавлю новый Gem в свой существующий проект, он будет работать нормально.В моем файле Gemfile.lock у меня есть:
actioncable (5.2.3)
actionpack (= 5.2.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
и:
nio4r (2.5.1)