bundle install エラーが出るとき

bundle install

Ubuntu14.04でrails 環境を整えていると
gem therubyracerを入れろと怒られる.

$ vim Gemfile

で以下の行をコメントアウト

gem 'therubyracer', platforms: :ruby

そしてbundle install

しかし,エラー...

Installing therubyracer 0.12.2 with native extensions

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

とか出る.

そこで,

$ gem uninstall libv8
$ gem uninstall therubyracer
$ brew rm v8
$ brew tap homebrew/dupes
$ brew install apple-gcc42
$ brew tap homebrew/versions
$ brew install v8-315
$ brew link --force v8-315
$ gem install libv8 -- --with-system-v8
$ gem install therubyracer
$ bundle config --local build.libv8 --with-cxx=/usr/local/bin/g++-4.2
$ bundle install

ok

以上.

Go Top