gem install therubyracer` fails on Mac OS X Lion



gem install therubyracer` fails on Mac OS X Lion.

gem install therubyracer -v ‘0.10.1’ 失败
报错如下:
  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’
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’
解决方式:
  1. brew tap homebrew/dupes
  2. brew install apple-gcc42
  3. export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
  4. export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
  5. export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2
  6. brew uninstall v8gem uninstall libv8
  7. gem install therubyracer -v ’0.10.2′
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 v8gem uninstall libv8
gem install therubyracer -v '0.10.2'
参考资料: