質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Q&A

解決済

2回答

882閲覧

bundlerのバージョンを変えようとするが失敗する

ayachika

総合スコア36

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

0グッド

0クリップ

投稿2019/08/14 06:23

編集2019/08/14 06:25

当方、外部のプロジェクト参加をしようとしているのですが、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のバージョンを合わせたいと考えております。
解決方法について、どうかご教示ください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

自己解決

bundle installを実行したらnokogiri関連でエラーが出る2という記事を見つけ解決することができました。

$ gem uninstall nokogiri $ gem install nokogiri -- --use-system-libraries $ bundle _1.3.0_ install

その後、pumaで同じようなエラーが出たため、また一つ一つ解決していきたいと思います。

投稿2019/08/14 13:58

ayachika

総合スコア36

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

bash

1sudo gem update --system

を実行してみてください(sudoは必要なら)。

投稿2019/08/14 06:41

編集2019/08/14 06:42
Mugheart

総合スコア2344

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ayachika

2019/08/14 12:48

Mugheart 様 ご回答ありがとうございます。ご助言通りトライしてみましたが、やはりnokogiriのところで同じエラーが出てbundler1.3.0のバージョンに切り替えられませんでした。。自分でも色々検索してみるのですが、お手上げ状態です。コメントいただいたのに申し訳ありません。
ayachika

2019/08/14 13:54

Mugheart 様 ネット上の記事を検索しておりましたら、解決法を見つけることができました。当方の検索不足でした。 ご助言ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問