Rails bundle install therubyracer 失败,有人遇到吗?

Summic · 2012年03月09日 · 最后由 522952110 回复于 2018年12月19日 · 8843 次阅读

下载了 shopqi 项目,走到执行 bundle install 走到 therubyracer 就失败了, 我是 lion 10.7.3 Bundler version 1.1.0

错误提示片段如下:

Installing therubyracer (0.9.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/Summic/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /Users/Summic/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile

make
compiling rr.cpp
clang: warning: argument unused during compilation: '-rdynamic'
clang: warning: argument unused during compilation: '-ggdb'
rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
                                           ^~~~~~~~~~~~~~~~~~
/Users/Summic/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^

装过 Xcode Developer Tools 没有?

#1 楼 @huacnlee 装了,之前 rvm ruby rails 都安装成功了

没看到错误,只看到了 warning

#3 楼 @hhuai 我觉得关键信息是这一行

/Users/Summic/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

bundle update

bundle install

就好了,不知道什么原因

旧版本的是遇到过这样的问题,升级到新版本就 ok 了

gem install therubyracer --pre 解决了

首先安装 gem install libv8 然后安装 gem install therubyracer

这样就不会出错啦

https://bbs.ichunqiu.com/thread-48867-1-1.html 这里有详细解释 windows 下的同学们看过来啦

需要 登录 后方可回复, 如果你还没有账号请 注册新账号