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

时间:2013-09-05 20:58:38

标签: ruby-on-rails bundler

我将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开发人员,所以任何想法都非常感激。

6 个答案:

答案 0 :(得分:30)

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

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

适用于小牛队的RVM。

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

答案 1 :(得分:8)

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

gem uninstall libv8
brew install v8
gem install libv8

答案 2 :(得分:3)

执行:

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

答案 3 :(得分:0)

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

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

答案 4 :(得分:0)

当我从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)宝石没有问题。

假设您使用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

答案 5 :(得分:-1)

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

$ gem uninstall libv8 # select "All Versions" if prompted
$ gem install libv8
相关问题