当方、外部のプロジェクト参加をしようとしているのですが、rubyの環境構築にかなり手間取っており、四苦八苦しております。
色々なエラーを一つずつ解決しているのですが、また新たにエラーが発生しました。
##出たエラーの内容
$ bundle install --path vendor/bundle
まず、上記を実行したところ、Gemfileに記載されているbundlerのバージョンが >=1.3.0だが、指定されているバージョンが2.3.0なので合いませんというエラーが出ました。
##対処した方法
そこで、デフォルトで指定されているbundlerのバージョン2.3.0を、bundlerのバージョンを変えようとしました。
Ruby | bundler を特定のバージョンに切り替えて実行するを参考にしました。
インストールされているバージョンを表示 $ gem list bundler *** LOCAL GEMS *** bundler (2.0.2, default: 1.17.3, 1.3.0) 指定したバージョンを使用する $ bundle _1.3.0_ install Updating git://github.com/smartinez87/exception_notification.git Fetching gem metadata from https://rubygems.org/........ Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Using rake (12.3.3) Using concurrent-ruby (1.1.5) Using i18n (0.9.5) Using json (1.8.6) Using minitest (5.11.3) Using thread_safe (0.3.6) Using tzinfo (1.2.5) Using activesupport (4.2.0) Using builder (3.2.3) Using erubis (2.7.0) Using mini_portile2 (2.4.0) Installing nokogiri (1.10.4) Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/user/myprojects/project/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.4/ext/nokogiri /Users/user/.rbenv/versions/2.3.0/bin/ruby -I /Users/user/.rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0 -r ./siteconf20190814-21968-spxpvu.rb extconf.rb '' extconf failedno implicit conversion of nil into String Gem files will remain installed in /Users/user/myprojects/project/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.4 for inspection. Results logged to /Users/user/myprojects/project/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/nokogiri-1.10.4/gem_make.out An error occurred while installing nokogiri (1.10.4), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.10.4'` succeeds before bundling.
上記に書いてある通りに実行すると、下記の通り成功しましたと表示されますが、もう一度bundlerのバージョンを指定しようとすると同じエラーが再度出ます。
$ gem install nokogiri -v '1.10.4' Building native extensions. This could take a while... Successfully installed nokogiri-1.10.4 Parsing documentation for nokogiri-1.10.4 Done installing documentation for nokogiri after 2 seconds 1 gem installed usernoMacBook-Air:project user$ bundle _1.3.0_ install Updating git://github.com/smartinez87/exception_notification.git Fetching gem metadata from https://rubygems.org/........ Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Using rake (12.3.3) Using concurrent-ruby (1.1.5) Using i18n (0.9.5) Using json (1.8.6) Using minitest (5.11.3) Using thread_safe (0.3.6) Using tzinfo (1.2.5) Using activesupport (4.2.0) Using builder (3.2.3) Using erubis (2.7.0) Using mini_portile2 (2.4.0) Installing nokogiri (1.10.4) Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/user/myprojects/user/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.4/ext/nokogiri /Users/user/.rbenv/versions/2.3.0/bin/ruby -I /Users/user/.rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0 -r ./siteconf20190814-33161-1l4bn.rb extconf.rb '' extconf failedno implicit conversion of nil into String Gem files will remain installed in /Users/user/myprojects/project/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.4 for inspection. Results logged to /Users/user/myprojects/project/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/nokogiri-1.10.4/gem_make.out An error occurred while installing nokogiri (1.10.4), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.10.4'` succeeds before bundling.
参考までにPATHはあっていると思います。 $ which bundle /Users/ayakakaminagayoshi/.rbenv/shims/bundle
複数の問題が重なっているようで、一つ一つ分解して解決しようとしますが、新たなエラーが出てきてしまいます。
まずはbundlerのバージョンを合わせたいと考えております。
解決方法について、どうかご教示ください。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。