`gem install therubyracer` fails on Mac OS X Lion

gem install therubyracer -v ‘0.10.1’ 失败

报错如下:

clang: error: no such file or directory: '/Users/XXX/.rvm/gems/ruby-1.9.2-p320/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a’

解决方式:

brew tap homebrew/dupes
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'

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

你可能感兴趣的:(Lion)