libv8(3.11.8.17)在Mac上捆绑安装错误

我将ruby升级到1.9.3,现在我无法启动服务器。 当我运行bundle install时,它说

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

当我尝试安装那个gem时,它说

 ERROR: Error installing libv8: ERROR: Failed to build gem native extension. /Users/Erica/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb creating Makefile Compiling v8 for x64 Using python 2.7.1 Unable to find a compiler officially supported by v8. It is recommended to use GCC v4.4 or higher Using compiler: g++ Unable to find a compiler officially supported by v8. It is recommended to use GCC v4.4 or higher 

我是一个HTML / CSS编码器,不是真正的Ruby开发人员,所以任何想法都非常感激。

我使用以下命令解决了这个问题:

gem install libv8 -v 3.11.8.17 -- --with-system-v8

它适用于Mavericks上的RVM。

https://stackoverflow.com/a/19667419/763744

尝试在自制程序中重新安装v8:

 gem uninstall libv8 brew install v8 gem install libv8 

做:

 gem install rmagick -v '2.13.2' gem install libv8 -v 3.11.8.17 -- --with-system-v8 

我已经遇到过几次这个问题了,我首先尝试的是(重新)安装command line tools 。 通常应该工作。

另一次成功的尝试是卸载libv8 ,然后再次安装它。 这需要很长时间……

当我从OSX Mountain Lion升级到OSX Mavericks时,我遇到了同样的问题。

从ruby-1.8.7-p354升级到ruby-1.8.7-375对我来说是个窍门。

安装了libv8(3.16.14.3-x86_64-darwin-13)和therubyracer(0.12.0)gem没有问题。

假设你使用rbenv:

 rbenv versions system * 1.8.7-p354 2.0.0-rc2 rbenv uninstall 1.8.7-p354 rbenv install 1.8.7-p375 rbenv versions system * 1.8.7-p375 2.0.0-rc2 bundle install 

这个简单的解决方案对我有用:

 $ gem uninstall libv8 # select "All Versions" if prompted $ gem install libv8