简体   繁体   English

在Mountain Lion上为ree安装libv8失败

[英]Installing libv8 for ree on Mountain Lion fails

I've been trying to find a solution to this for a few days now and no luck. 我一直试图找到一个解决方案,现在几天没有运气。 If anyone has been successful installing the libv8 gem for REE 1.8.7 on ML, could you please let me know the process you followed? 如果有人在ML上成功安装REE 1.8.7的libv8 gem,你能告诉我你所遵循的过程吗?

I have both the XCode LLVM compiler as well as the kennethreitz GCC package for 10.7+ v2 installed. 我同时安装了XCode LLVM编译器以及用于10.7+ v2的kennethreitz GCC包。

The output when trying to install with native extensions is: 尝试使用本机扩展安装时的输出是:

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

(The results logged are the exact same as the error). (记录的结果与错误完全相同)。

这对我有用。

RUBYOPT=-rrubygems gem install therubyracer

I was able to successfully install the libv8 gem on Mountain Lion on a freshly installed ree-1.8.7. 我能够在新安装的ree-1.8.7上成功地在Mountain Lion上安装libv8 gem。 I believe the issue you're seeing stems from the GCC version being used. 我相信您所看到的问题源于使用的GCC版本。

As is now described in the osx-gcc-installer's README you should switch from Kenneth Reitz's LLVM-version of GCC to the GCC 4.2 that is available via Homebrew or Macports. 正如现在在osx-gcc-installer的README中所描述的那样,你应该从Kenneth Reitz的LLVM版本的GCC切换到可以通过Homebrew或Macports获得的GCC 4.2。

Homebrew instructions: http://coderwall.com/p/dtbuqg 自制的说明: http//coderwall.com/p/dtbuqg

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

Note that you will want to set the CC path and establish the necessary symlink as described in those articles. 请注意,您将需要设置CC路径并按照这些文章中的描述建立必要的符号链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM