我一直试图找到一个解决方案,现在几天没有运气。如果有人在ML上成功安装REE 1.8.7的libv8 gem,你能告诉我你所遵循的过程吗?
我同时安装了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 :(得分:4)
这对我有用。
RUBYOPT=-rrubygems gem install therubyracer
答案 1 :(得分: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路径并按照这些文章中的描述建立必要的符号链接。