2012-05-07 106 views
6

我一直在试图找到一个这样的解决方案,现在几天没有运气。如果有人已经成功地在ML上安装了用于REE 1.8.7的libv8 gem,能否让我知道您遵循的过程?在山狮上安装libv8 for ree

我同时安装了XCode LLVM编译器和用于10.7+ v2的kennethreitz GCC包。

试图与本地扩展到安装时的输出是:

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

     /Users/XXXXX/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/Users/XXXXX/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby 
extconf.rb:13: uninitialized constant Gem (NameError) 
Checking for Python... 

Gem files will remain installed in /Users/XXXXX/.rvm/gems/ree-1.8.7-2012.02/gems/libv8-3.3.10.4 for inspection. 
Results logged to /Users/XXXXX/.rvm/gems/ree-1.8.7-2012.02/gems/libv8-3.3.10.4/ext/libv8/gem_make.out

(记录的结果是准确的相同误差)。

+0

我有同样的问题。仍然没有运气? – gdavis

回答

1

我能够在新安装的ree-1.8.7上成功安装Mountain Lion上的libv8 gem。我相信你看到的问题源于使用的GCC版本。

如现在在osx-gcc-installer's README中所述,您应该从Kenneth Reitz的LLVM版本的GCC切换到可通过Homebrew或Macports提供的GCC 4.2。

家酿说明: http://coderwall.com/p/dtbuqg

MacPorts的说明: http://coderwall.com/p/pagj2w

请注意,您将要设置的CC路径和在这些文章中建立必要的符号链接。

+0

嘿肯尼。您成功安装了哪个版本的libv8和therubyracer?这是使用gcc-4.2? –

4

这对我有效。

RUBYOPT=-rrubygems gem install therubyracer