LoginSignup
5
3

More than 5 years have passed since last update.

bundle installでBuildErrorとかが出てしまった時やった対処法

Posted at

前置き

$ bundle exec rake db:create db:migrate db:seed

をコマンドで打ったり

$ rails -v

をコマンドで打ったときになぜか

Your bundle is locked to activesupport (4.2.4), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of activesupport (4.2.4) has removed it. You'll need to update your bundle to a different version of activesupport (4.2.4) that hasn't been removed in order to install.
Run `bundle install` to install missing gems.

というエラーメッセージが帰ってくるようになってしまい、bundle installしても

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

とか

An error occurred while installing libv8 (3.16.14.15), and Bundler
cannot continue.
Make sure that `gem install libv8 -v '3.16.14.15'` succeeds before bundling.

とかエラーになってしまうので、どうしたもんかと思って解決策を探ってみました。

エラーメッセージの内容で検索をしてみたところ
An error occurred while installing libv8 (3.16.14.15), and Bundler
cannot continue.
この部分でヒットしたものが解決策になりました。

参考(というかほぼそのままw)

$ gem install libv8 -v '3.16.14.11' -- --with-system-v8
$ bundle config build.libv8 --with-system-v8
$ bundle update

これでinstallできてなかったものがしっかりとインストールできて

rails -v

とかでもしっかりとrailsのバージョンを明示してくれるようになりました。

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3