The installation of the libv8 gem (anything after v3.3.10) fails with a message 'Killed'.
I'm including libv8 & therubyracer in my Gemfile:
group :production, :staging do
gem 'libv8'
gem 'therubyracer'
end
The bundle update
works fine locally (Mac OS X ). When I do a cap staging deploy
, the deploy fails with:
* 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
If I go to the server (Debian 6 32bit on Linode, Linux 3.5.2-linode45) and run bundle exec gem install libv8 -v '3.11.8.9'
, it fails with:
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
At the moment, I have to specify old versions of therubyracer & libv8 in order to get my deploy to be successful:
group :production, :staging do
gem 'libv8', '~> 3.3.10'
gem 'therubyracer', '~> 0.10.2'
end
It seems like this Issue might be related.
Is there a fix for this?
Things were sorted out on January 7th, 2013 ... but everything fell apart again one day later. Another day after that, and it looks like things are back together again!
therubyracer v0.11.1 now depends on the libv8 gem, again. So, my Gemfile has changed to:
group :production, :staging do
gem 'therubyracer'
end
This installs the latest version of therubyracer (v0.11.1), along with the latest version of libv8 (v3.11.8.13). This has completely sorted out the issue for me - so, therubyracer v0.11.1 & libv8 v3.11.8.13 gems are installing just fine.
If that's not the case for you, then there are still options. For the Rails apps that still won't deploy with that, I've had success with:
group :production do
gem 'libv8', '3.11.8.10'
gem 'therubyracer'
end
It's also possible (and probably the better choice) to just stick with the known-good versions until all of this is sorted out by changing your Gemfile to:
group :production do
gem 'therubyracer', '0.10.2'
end