1

我正在尝试在 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
4

1 回答 1

13

我刚刚遇到了完全相同的错误。我查看了https://rubygems.org/gems/therubyracer上的 gem 详细信息,似乎我们“幸运”地在发布日捆绑了一个新版本。

这似乎已经被报告:https ://github.com/cowboyd/therubyracer/issues/215

所以,我认为最简单的方法是使用最新版本的 gem。所以我更新了我的 Gemfile 以指向最后一个版本,如下所示:

gem "therubyracer", "~> 0.10.2"

我能够成功安装gem。

如果要手动安装 gem,可以使用:

gem install therubyracer --version "~> 0.10.2"
于 2012-12-05T05:33:43.740 回答