ruby - 无法安装 therubyracer

标签 ruby rubygems therubyracer

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

最佳答案

我刚刚遇到了完全相同的错误。我在 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"

关于ruby - 无法安装 therubyracer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13715902/

相关文章:

javascript - 观察者在 IE 中不起作用

ruby-on-rails - 由于 "Please install the postgresql adapter"错误,在新创建的不使用 postgres 的应用程序中,Rails 控制台无法打开

ruby-on-rails - 是否可以将 Rails 应用程序的迁移添加到 ruby​​ gem?

ruby-on-rails - gem install therubyracer -v 0.11.4 在 OS X 10.10 上失败

ruby-on-rails - SSL错误安装rubygems时,无法在windows 10中安装rails gem

ruby-on-rails - 将html表的值提交给 Controller ruby中的变量

ruby-on-rails - 如何检查对象是否为 nil?

therubyracer - gem 安装therubyracer -v '0.11.4'吗?

macos - Ruby Racer 惰性符号绑定(bind)失败

ruby - 如何在 Ruby 中将散列值从字符串转换为数组?