libv8 gem(v3.3.10之后的所有版本)的安装失败,并显示消息“已杀死”。

我在我的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 32bit,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 gem可以很好地安装了。

如果您不是这种情况,那么仍然有选择。对于仍然无法部署的Rails应用程序,我已经取得了成功:

group :production do
  gem 'libv8', '3.11.8.10'
  gem 'therubyracer'
end


也有可能(可能是更好的选择)坚持使用已知良好的版本,直到通过将Gemfile更改为以下方式来解决所有这些问题:

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

10-08 04:24