LoginSignup
10

More than 5 years have passed since last update.

El Capitanでtherubyracerとlibv8を「bundle install」できない時の対処法

Last updated at Posted at 2016-04-07

解決方法

v8のアンインストール

brew list

でv8が入っている場合は、アンインストールする。

brew uninstall v8

v8(v8-315)を改めてインストール

brew tap homebrew/versions
brew install v8-315

libv8とtherubyracerをインストール

libv8とtherubyracerをパラメータをつけてgem install

gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315

bundle installを実行

bundle install

therubyracerでエラーが発生する場合は、

bundle config build.therubyracer --with-v8-dir=/usr/local/opt/v8-315

をしてからbundle installを再実行。

環境

$ sw_vers -productVersion 
10.11.4
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
$ gem -v
2.5.1
$ bundle -v
Bundler version 1.11.2

問題

Gemfileにgem "therubyracer"を追加してbundle installした時にエラーが発生。これ自体はv8とlibv8とtherubyracerのバージョン関連の痴話げんか的なあるある問題らしい。

以下のリンクを参考にごちゃごちゃやったが、解決せず。

http://l-light-note.hatenablog.com/entry/2014/09/17/134807
http://stackoverflow.com/questions/33475709/install-therubyracer-gem-on-osx-10-11-el-capitan
http://qiita.com/yakiimo23/items/eaf48164821897e3dde9

以下を参考にした結果、gem install therubyracer ...まではうまくいったが、bundle installで失敗した。

とりあえずgem install ...と同じconfigをbundleに設定してみたらうまくいったが、これが正しい解決策かはわからないので誰か教えてください。

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
10