2012-05-07 103 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