我正在尝试在Debian 6上做一个gem install therubyracer。我在1.9.3上使用rbenv。当我最初这样做时,它抱怨了libv8,所以我做了一个gem install libv8。现在,当我运行gem install therubyracer时,我收到以下错误,说它无法找到该文件。它正在讨论的文件是/home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.3-x86_64-linux/vendor/v8/out/ x64.release / obj.target / tools / gyp / libv8_base.a确实存在。
hop@fev-temp:~$ gem install therubyracer
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/home/chop/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb
checking for main() in -lpthread... yes
creating Makefile
make
compiling stack.cc
compiling accessor.cc
compiling constants.cc
compiling heap.cc
compiling init.cc
compiling primitive.cc
compiling signature.cc
compiling date.cc
compiling locker.cc
compiling exception.cc
compiling gc.cc
compiling script.cc
compiling external.cc
compiling v8.cc
compiling object.cc
compiling trycatch.cc
compiling context.cc
compiling string.cc
compiling value.cc
compiling array.cc
compiling invocation.cc
compiling message.cc
compiling constraints.cc
compiling function.cc
compiling backref.cc
compiling handles.cc
compiling template.cc
compiling rr.cc
linking shared-object v8/init.so
/home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.3-x86_64-linux/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: No such file or directory
collect2: ld returned 1 exit status
make: *** [init.so] Error 1
Gem files will remain installed in /home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0 for inspection.
Results logged to /home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out
答案 0 :(得分:13)
我刚刚遇到完全相同的错误。我查看了https://rubygems.org/gems/therubyracer处的宝石详细信息,看起来我们“幸运”足以在发布日捆绑新版本。
这似乎已经报告:https://github.com/cowboyd/therubyracer/issues/215
所以,我认为最简单的方法是使用最新版本的gem。所以我更新了我的Gemfile以指向最后一个版本:
gem "therubyracer", "~> 0.10.2"
我能够成功安装宝石。
如果您想手动安装gem,可以使用:
gem install therubyracer --version "~> 0.10.2"