ruby-on-rails - 尝试安装 libv8 v3.11.8.9 时如何解决此问题?

标签 ruby-on-rails gem linode therubyracer

libv8 gem(v3.3.10 之后的任何内容)的安装失败并显示消息“Killed”。

我在我的 Gemfile 中包含了 libv8 和 therubyracer:

group :production, :staging do
  gem 'libv8'
  gem 'therubyracer'
end
bundle update在本地工作正常(Mac OS X)。当我做 cap staging deploy ,部署失败:
  * 2013-01-04 19:17:51 executing `bundle:install'
  * executing "cd /path/to/app/app-staging/releases/20130105001748 && bundle install --gemfile /path/to/app/app-staging/releases/20130105001748/Gemfile --path /path/to/app/app-staging/shared/bundle --deployment --quiet --without development"
    servers: ["staging.app.com"]
    [staging.app.com] executing command
 ** [out :: staging.app.com] bash: line 1:  4324 Killed                  bundle install --gemfile /path/to/app/app-staging/releases/20130105001748/Gemfile --path /path/to/app/app-staging/shared/bundle --deployment --quiet --without development
    command finished in 48980ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /path/to/app/app-staging/releases/20130105001748; true"
    servers: ["staging.app.com"]
    [staging.app.com] executing command
    command finished in 1928ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.3-p327@app' -c 'cd /path/to/app/app-staging/releases/20130105001748 && bundle install --gemfile /path/to/app/app-staging/releases/20130105001748/Gemfile --path /path/to/app/app-staging/shared/bundle --deployment --quiet --without development'" on staging.app.com

如果我转到服务器(Linode 上的 Debian 6 32 位,Linux 3.5.2-linode45)并运行 bundle exec gem install libv8 -v '3.11.8.9' ,它失败了:
Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
  ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
creating Makefile
Using compiler: /usr/bin/g++
g++: Internal error: Killed (program cc1plus)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make[1]: *** [/path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/v8_base/src/api.o] Error 1
make: *** [ia32.release] Error 2
/path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
  from /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/ext/libv8/location.rb:35:in `each'
  from /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/ext/libv8/location.rb:35:in `verify_installation!'
  from /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/ext/libv8/location.rb:26:in `install!'
  from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
  build/gyp/gyp --generator-output="out" build/all.gyp \
                -Ibuild/standalone.gypi --depth=. \
                -Dv8_target_arch=ia32 \
                -S.ia32 -Dhost_arch=ia32
make[1]: Entering directory `/path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out'
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/allocation.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/bignum.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/cached-powers.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/conversions.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/diy-fp.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/dtoa.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/fast-dtoa.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/fixed-dtoa.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/once.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/preparse-data.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/preparser.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/preparser-api.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/scanner.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/strtod.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/token.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/unicode.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/utils.o
  AR(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/tools/gyp/libpreparser_lib.a
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/preparser/preparser/preparser-process.o
  LINK(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/preparser
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/v8_base/src/accessors.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/v8_base/src/allocation.o
  CXX(target) /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out/ia32.release/obj.target/v8_base/src/api.o
make[1]: Leaving directory `/path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/vendor/v8/out'


Gem files will remain installed in /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9 for inspection.
Results logged to /path/to/app/app-staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.9/ext/libv8/gem_make.out

目前,我必须指定旧版本的 therubyracer 和 libv8 才能使我的部署成功:
group :production, :staging do
  gem 'libv8', '~> 3.3.10'
  gem 'therubyracer', '~> 0.10.2'
end

好像this Issue可能是相关的。

有没有办法解决这个问题?

最佳答案

事情在 2013 年 1 月 7 日解决了……但一天后一切又崩溃了。又过了一天,看起来事情又恢复了!

therubyracer v0.11.1 现在再次依赖于 libv8 gem。因此,我的 Gemfile 已更改为:

group :production, :staging do
  gem 'therubyracer'
end

这将安装最新版本的 therubyracer (v0.11.1),以及最新版本的 libv8 (v3.11.8.13)。这对我来说已经完全解决了这个问题 - 所以,therubyracer v0.11.1 & libv8 v3.11.8.13 gems 安装得很好。

如果您不是这种情况,那么仍有选择。对于仍然不会部署的 Rails 应用程序,我已经取得了成功:
group :production do
  gem 'libv8', '3.11.8.10'
  gem 'therubyracer'
end

也可以(并且可能是更好的选择)坚持使用已知良好的版本,直到通过将 Gemfile 更改为以下内容来解决所有这些问题:
group :production do
  gem 'therubyracer', '0.10.2'
end

关于ruby-on-rails - 尝试安装 libv8 v3.11.8.9 时如何解决此问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14167280/

相关文章:

ruby-on-rails - 阵列::包括?在 ActiveRecord 集合上不调用 op==?

ruby-on-rails - 获取错误 Apple 推送通知 OpenSSL::SSL::SSLError

ruby-on-rails - Capistrano 和 GitHub 私有(private) repo - 权限被拒绝(公钥)

ruby-on-rails - 带 rails 的 Handlebars / mustache url_for

ruby-on-rails - 在范围内传递参数

ruby - 如何配置 Bundler/Gemfile 以在开发期间使用不同的 gem 源?

ruby-on-rails - 从命令行安装 gem 与更改 gemfile

apache-spark - 在集群 : Initial job has not accepted any resources 上运行 Spark

ruby-on-rails - 已部署的 Rails 应用程序出现 Postgresql 错误

ruby-on-rails - 如何使用new_record?,改变了?并坚持?本例中 Rails 中的方法