Gem 安装 therubyracer 0.9.9 的时候报错,

towonzhou · 2014年12月02日 · 最后由 hlcfan 回复于 2014年12月06日 · 3583 次阅读

我的 libv8 版本是 3.3.10.4 gcc48 求指教怎么把 therubyracer 给装上去..

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

/Users/tonyzhou/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -r ./siteconf20141202-23353-1mos9l3.rb extconf.rb checking for main() in -lobjc... yes creating Makefile

make clean

make compiling rr.cpp clang: warning: argument unused during compilation: '-rdynamic' rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 1 warning generated. compiling v8.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_array.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_callbacks.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_context.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_date.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_debug.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_exception.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_exception.cpp:10:16: warning: unused variable 'stack' [-Wunused-variable] static void* stack[20]; ^ 1 warning generated. compiling v8_external.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable] VALUE references; ^ 1 warning generated. compiling v8_function.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_handle.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_locker.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_locker.cpp:45:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ v8_locker.cpp:85:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ 2 warnings generated. compiling v8_message.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_object.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_object.cpp:77:19: warning: unused variable 'proto' [-Wunused-variable] Handle proto(rr_rb2v8(prototype)); ^ 1 warning generated. compiling v8_script.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_string.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_template.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_try_catch.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_v8.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_value.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_value.cpp💯9: warning: unused function 'ToInt32' [-Wunused-function] VALUE ToInt32(VALUE self) { ^ 1 warning generated. compiling v8_weakref.cpp clang: warning: argument unused during compilation: '-rdynamic' linking shared-object v8.bundle ld: library not found for -lv8 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [v8.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/tonyzhou/.rvm/gems/ruby-1.9.3-p125/gems/therubyracer-0.9.9 for inspection. Results logged to /Users/tonyzhou/.rvm/gems/ruby-1.9.3-p125/extensions/x86_64-darwin-14/1.9.1/therubyracer-0.9.9/gem_make.out

brew install nodejs

我猜你的系统是 Yosemite 吧,找一个装好 libv8 的系统,把 libv8.a 考到需要的地方

#1 楼 @alixiaomiao node 装了,还是不行...

https://github.com/cowboyd/libv8#bring-your-own-v8

gem uninstall libv8
gem install libv8 -- --with-system-v8
bundle 

it works for yosemite .

some other links: https://github.com/cowboyd/therubyracer/search?utf8=%E2%9C%93&q=yosemite&type=Issues

升级到最新的 therubyracer 试试?

#2 楼 @hlcfan 对 就是 Yosemitecd .. libv8.a 在哪儿呢 /usr/local/lib下吗? 别人机器上也没找到

#5 楼 @dongqs 新的能装上,但只能装 0.9.9 诶

#7 楼 @towonzhou 好奇是因为什么不能升级?

#8 楼 @dongqs 因为升级很轻易的装上了,,,,,,装不上想办法装上才好玩儿

#9 楼 @towonzhou 。。。真是。。。太闲了。。。

#6 楼 @towonzhou 找个 marvericks 的机器

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