繁体   English   中英

在Mavericks上安装libv8和therubyracer

[英]Installing libv8 and therubyracer on Mavericks

我要撕了我的头发试图让therubyracer宝石安装在小牛10.9 -任何帮助将非常感激。

我知道关于此主题还有很多其他问题,但是从字面上看,以下任何一项都无法解决任何问题(包括各种组合和有希望的重审,到目前为止已经消耗了2天以上)

  1. 卸载libv8并安装therubyracer
  2. 改用brew install libv8
  3. 安装apple-gcc或类似产品
  4. 安装各种版本的XcodeDeveloper Tools
  5. 重新安装rvm并重建ruby 1.9.3

我能够获得的最新消息是得到以下错误消息:

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

    /Users/aqua/.rvm/rubies/ruby-1.9.3-p545/bin/ruby -r ./siteconf20150127-54061-10i2fna.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile

make  clean

make
compiling accessor.cc
g++-4.6: error: unrecognized option '-rdynamic'
make: *** [accessor.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/aqua/.rvm/gems/ruby-1.9.3-p545/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/aqua/.rvm/gems/ruby-1.9.3-p545/extensions/x86_64-darwin-13/1.9.1/therubyracer-0.12.1/gem_make.out

关于g++-4.6: error: unrecognized option '-rdynamic'似乎没有太多信息g++-4.6: error: unrecognized option '-rdynamic' 我的第一个猜测可能是gcc46不支持该标志。

根据其他发布建议,我尝试安装apple-gcc42

brew tap homebrew/dupes
brew install apple-gcc42

并使用适当的环境上下文变量再次执行它以将其指向新的apple-gcc42安装:

> $ CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2 CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 gem install therubyracer

仍然没有运气,这是奇怪的还是乱扔同样的错误gcc46 ,这使我的东西,它不是拿起apple-gcc42 可言

我什至尝试链接正确的版本(当然要备份原始版本)

cd /usr/bin

mv gcc gcc_backup
mv g++ g++_backup
mv cpp cpp_backup

sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/gcc
sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 /usr/bin/g++
sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2 /usr/bin/cpp

绝对没有运气,仍然会抛出g++-4.6: error: unrecognized option '-rdynamic'

因此.. 如何强制gem install使用特定的编译器版本? 那是正确的方法吗?

谢谢您的帮助!

我也面临同样的问题。 遵循与上述相同的步骤。 以下是我安装therubyracer所做的其他导出。

export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2

我没有做

接下来,卸载libv8 gem

gem uninstall libv8

终于安装了therubyracer

gem install therubyracer -v='0.12.2'

我正在使用ruby 2.2.2,希望这会有所帮助。

暂无
暂无

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

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