Help us understand the problem. What is going on with this article?

therubyracerが入らない

More than 5 years have passed since last update.
bundle install

をしたら

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

とエラーが。。。

書いてある通り

gem install therubyracer -v '0.10.2'

をすると

Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

(略)

make failed, exit code 2

Gem files will remain installed in /Users/UserName/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/therubyracer-0.10.2 for inspection.
Results logged to /Users/UserName/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/therubyracer-0.10.2/gem_make.out

こんな感じの長いエラー文が現れた。

解決策

以下を実行する。

brew tap homebrew/dupes # Thanks Tom
brew install apple-gcc42

export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2

brew uninstall v8

gem uninstall libv8

gem install therubyracer -v '0.10.2' # specify version

これで無事therubyracer(0.10.2)がinstallされbundle installもうまくいきました。

参考:http://stackoverflow.com/questions/19630154/gem-install-therubyracer-v-0-10-2-on-osx-mavericks-not-installing

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away