rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 192 forks source link

Can't install on Ubuntu 12 (64bits) #189

Closed luizkowalski closed 12 years ago

luizkowalski commented 12 years ago

I'm trying to install therubyracer on a private cloud...This is my config Linux cloudoc 3.2.0-23-virtual #36-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

When I run gem install therubyracer -v '0.11.0beta8' I got this

Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpthread... yes
creating Makefile

make
compiling stack.cc
compiling handles.cc
compiling constants.cc
compiling message.cc
compiling invocation.cc
compiling context.cc
compiling template.cc
compiling accessor.cc
compiling trycatch.cc
compiling external.cc
compiling heap.cc
compiling exception.cc
compiling gc.cc
compiling object.cc
compiling v8.cc
compiling string.cc
compiling function.cc
compiling script.cc
compiling backref.cc
compiling init.cc
compiling date.cc
compiling value.cc
compiling constraints.cc
compiling signature.cc
compiling primitive.cc
compiling locker.cc
compiling array.cc
compiling rr.cc
linking shared-object v8/init.so
/usr/bin/ld: /var/lib/gems/1.9.1/gems/libv8-3.11.8.0/vendor/v8/out/x64.release/obj.target/v8_base/src/api.o: relocation R_X86_64_32S against `vtable for v8::ScriptData' can not be used when making a shared object; recompile with -fPIC
/var/lib/gems/1.9.1/gems/libv8-3.11.8.0/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [init.so] Error 1

Gem files will remain installed in /var/lib/gems/1.9.1/gems/therubyracer-0.11.0beta8 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/therubyracer-0.11.0beta8/ext/v8/gem_make.out

I tried uninstall libv8, install with --pre...neither worked

ernestorocha commented 12 years ago

Same here. I had to downgrade to beta5.

bashmish commented 12 years ago

The same for me.

We upgraded therubyracer because only new version compiles on OS X Mountain Lion, but now it doen't compile on Ubuntu servers.

cowboyd commented 12 years ago

@luizkowalski @bashmish there was a bug fix for libv8 on linux that addresses this issue. Please update libv8 to point to version ~> 3.11.8.3 in your gemfile.

cheers, Charles

bashmish commented 12 years ago

@cowboyd there is another error with it

Installing therubyracer (0.11.0beta8) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
checking for main() in -lpthread... yes
creating Makefile

make
compiling trycatch.cc
compiling constants.cc
compiling date.cc
compiling exception.cc
compiling script.cc
compiling accessor.cc
compiling invocation.cc
compiling rr.cc
compiling primitive.cc
compiling backref.cc
compiling locker.cc
compiling array.cc
compiling template.cc
compiling constraints.cc
compiling value.cc
compiling v8.cc
compiling heap.cc
compiling init.cc
compiling string.cc
compiling signature.cc
compiling handles.cc
compiling function.cc
compiling stack.cc
compiling object.cc
compiling gc.cc
compiling message.cc
compiling external.cc
compiling context.cc
linking shared-object v8/init.so
/var/lib/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: Malformed archive
collect2: ld returned 1 exit status
make: *** [init.so] Error 1

Gem files will remain installed in /home/bashmish/.bundler/tmp/10375/gems/therubyracer-0.11.0beta8 for inspection.
Results logged to /home/bashmish/.bundler/tmp/10375/gems/therubyracer-0.11.0beta8/ext/v8/gem_make.out
An error occured while installing therubyracer (0.11.0beta8), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.11.0beta8'` succeeds before bundling.
cowboyd commented 12 years ago

that is very odd. I use this version to deploy to x64 just fine. Which distro? You should be able to recompile it by setting :platform => :ruby

gem 'libv8', '~> 3.11.8.3', :platform => :ruby
bashmish commented 12 years ago

@cowboyd yes, it compiled after I added :platform => :ruby. Thanks a lot!

kcm commented 11 years ago

I'm still seeing this on Oneiric, Precise, and now Quantal. Using version 3.11.8.3, with and without ":platform -> :ruby". What can I provide to help further diagnose this? This is all x64 with therubyracer 0.11.0.

.../shared/bundle/ruby/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: Malformed archive

luizkowalski commented 11 years ago

try gem install libv8 before installing the gem

cowboyd commented 11 years ago

@kcm try 3.11.8.4

dannyellis-zz commented 11 years ago

Having the same issue as @kcm Ubuntu 12.04, tried both 3.11.8.3 and .4 for libv8 with and without platform set.

lukenorman commented 11 years ago

I'm having the same issue too

toptierlabs commented 11 years ago

Me one. Did anyone solve it?

lukenorman commented 11 years ago

Did a bit of googling around. Weirdly, gem uninstall lib v8, gem install liv v8, gem install therubyracer worked. I hope such a simple solution works for everyone else!

toptierlabs commented 11 years ago

It didnt worked for me. I am installing libv8 from source. I hope that linux guys could have the ability to make things easier. In my mac it worked on the first attempt.

toptierlabs commented 11 years ago

I installed libv8 from source and when tried to install therubyracer I got the following error:

Building native extensions. This could take a while... ERROR: Error installing therubyracer: ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb

checking for main() in -lpthread... yes Invalid gemspec in [/var/lib/gems/1.8/specifications/css_parser-1.2.6.gemspec]: invalid date format in specification: "2011-09-08 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/sass-rails-3.2.5.gemspec]: invalid date format in specification: "2012-03-19 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/carrierwave-0.6.2.gemspec]: Illformed requirement ["#YAML::Syck::DefaultKey:0x7f1f99e54600 1.1.4"] Invalid gemspec in [/var/lib/gems/1.8/specifications/remotipart-1.0.2.gemspec]: invalid date format in specification: "2012-02-03 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-2.0.2.gemspec]: invalid date format in specification: "2012-04-03 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/mini_magick-3.4.gemspec]: invalid date format in specification: "2011-12-28 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z" Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z" checking for v8.h... yes creating Makefile

make g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c constants.cc g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c string.cc g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c date.cc g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c locker.cc g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c stack.cc g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c constraints.cc g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c function.cc function.cc: In static member function 'static VALUE rr::Function::GetInferredName(VALUE)': function.cc:40:34: error: 'class v8::Function' has no member named 'GetInferredName' function.cc: In static member function 'static VALUE rr::Function::GetScriptColumnNumber(VALUE)': function.cc:48:12: error: 'class v8::Function' has no member named 'GetScriptColumnNumber' function.cc: In static member function 'static VALUE rr::Function::GetScriptId(VALUE)': function.cc:52:34: error: 'class v8::Function' has no member named 'GetScriptId' function.cc:53:3: warning: control reaches end of non-void function [-Wreturn-type] function.cc: In static member function 'static VALUE rr::Function::GetScriptColumnNumber(VALUE)': function.cc:49:3: warning: control reaches end of non-void function [-Wreturn-type] function.cc: In static member function 'static VALUE rr::Function::GetInferredName(VALUE)': function.cc:41:3: warning: control reaches end of non-void function [-Wreturn-type] make: *\ [function.o] Error 1

Gem files will remain installed in /var/lib/gems/1.8/gems/therubyracer-0.11.0 for inspection.

cowboyd commented 11 years ago

@toptierlabs you are using an incompatible version of v8, it must be 3.11.x

toptierlabs commented 11 years ago

I dont have that library installed. If I do gem which libv8 I get ERROR: Can't find ruby library file or shared library libv8

toptierlabs commented 11 years ago

/home/ubuntu/.rvm/gems/ruby-1.9.3-p327@mygems/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: Malformed archive collect2: ld returned 1 exit status make: *\ [init.so] Error 1

Here is my problem

ifyouseewendy commented 11 years ago

@toptierlabs `gem install libv8 --version '3.11.8.4' before bundle install, this worked.

tieguy commented 11 years ago

"@toptierlabs you are using an incompatible version of v8, it must be 3.11.x"

FWIW, libv8 3.11.8.9 fails here, with the "libv8_base.a: could not read symbols: Malformed archive" error reported by others. Deleting and rebuilding with --platform ruby fixed it for me.

shida commented 11 years ago

In Gemfile:

gem 'libv8', '3.11.8.4', :platform => :ruby gem 'therubyracer', '0.11.0', :platforms => :ruby

It worked for me.

cowboyd commented 11 years ago

@shida you should be able to just use 0.11.1 in your Gemfile without specifying libv8 version at all (since it is contained as a dependency of therubyracer now)

rajeshkp commented 11 years ago

@cowboyd just ran into the malformed archive issue right now and I was able to get past this issue by using therubyracer as part of the Gemfile dependencies on my 64bit Ubuntu 12.04 OS.

cmeiklejohn commented 11 years ago

Tried that, getting this:

/usr/local/rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/build.rb:50:in `build_with_rubygem_libv8': undefined local variable or method `libv8_include_flags' for main:Object (NameError)
cmeiklejohn commented 11 years ago

OK, adding the platforms bit fixed things. Why is this necessary?

cowboyd commented 11 years ago

@cmeiklejohn make sure you are using the latest version of therubyracer which fixed this bug.

pranas commented 11 years ago

I can't get latest version to work on Ubuntu 12.04

cowboyd commented 11 years ago

What is the symptom you are having?

pranas commented 11 years ago
Installing therubyracer (0.11.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
creating Makefile

make
compiling date.cc
compiling value.cc
compiling function.cc
compiling heap.cc
compiling script.cc
compiling backref.cc
compiling init.cc
compiling external.cc
compiling invocation.cc
compiling template.cc
compiling stack.cc
compiling constraints.cc
compiling object.cc
compiling string.cc
compiling constants.cc
compiling exception.cc
compiling trycatch.cc
compiling array.cc
compiling primitive.cc
compiling handles.cc
compiling context.cc
compiling rr.cc
compiling gc.cc
compiling v8.cc
compiling message.cc
compiling signature.cc
compiling locker.cc
compiling accessor.cc
linking shared-object v8/init.so
/home/bangel/app/releases/7849415e09aa938ad6ec54fe1f3aca44257f425d/vendor/bundle/ruby/1.9.1/gems/libv8-3.11.8.11-x86_64-linux/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Malformed archive
collect2: ld returned 1 exit status
make: *** [init.so] Error 1

I tried various therubyracer and libv8 combinations with no luck so far.

rajeshkp commented 11 years ago

Using therubyracer (0.11.1) from https://github.com/cowboyd/therubyracer.git (at master) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/ec2-user/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb 

checking for main() in -lpthread... yes creating Makefile

make compiling signature.cc compiling script.cc compiling backref.cc compiling accessor.cc compiling function.cc compiling trycatch.cc compiling rr.cc compiling external.cc compiling exception.cc compiling heap.cc compiling context.cc compiling constants.cc compiling handles.cc compiling template.cc compiling object.cc compiling string.cc compiling invocation.cc compiling value.cc compiling constraints.cc compiling gc.cc compiling primitive.cc compiling v8.cc compiling array.cc compiling init.cc compiling stack.cc compiling message.cc compiling date.cc compiling locker.cc linking shared-object v8/init.so /usr/bin/ld: /home/ec2-user/.rvm/gems/ruby-1.9.3-p362@app/gems/libv8-3.15.11.1/vendor/v8/out/x64.release/obj.target/v8_base/src/api.o: relocation R_X86_64_32S against `vtable for v8::ScriptData' can not be used when making a shared object; recompile with -fPIC /home/ec2-user/.rvm/gems/ruby-1.9.3-p362@app/gems/libv8-3.15.11.1/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *\ [init.so] Error 1

Gem files will remain installed in /home/ec2-user/.rvm/gems/ruby-1.9.3-p362@app/bundler/gems/therubyracer-e0852e896368 for inspection. Results logged to /home/ec2-user/.rvm/gems/ruby-1.9.3-p362@app/bundler/gems/therubyracer-e0852e896368/ext/v8/gem_make.out An error occurred while installing therubyracer (0.11.1), and Bundler cannot continue. Make sure that gem install therubyracer -v '0.11.1' succeeds before bundling.

pranas commented 11 years ago

Yeah, master doesn't work for me either.

Temporary solution:

  gem 'libv8', '3.3.10.4'
  gem 'therubyracer', '0.10.2'

I picked them from another project. You probably can use a bit newer versions.

cmeiklejohn commented 11 years ago

I've had no problem with specifying the latest version of the gem, with :platforms => :ruby. It appears that is the key, and by doing that there is no need to specify an explicit dependency of libv8 in your Gemfile.

On Wednesday, January 9, 2013 at 2:22 AM, Pranas Kiziela wrote:

Yeah, master doesn't work for me either. Temporary solution: gem 'libv8', '3.3.10.4' gem 'therubyracer', '0.10.2'
I picked them from another project. You probably can use a bit newer versions.

— Reply to this email directly or view it on GitHub (https://github.com/cowboyd/therubyracer/issues/189#issuecomment-12034209).

pranas commented 11 years ago

It doesn't change anything for me.

rajeshkp commented 11 years ago

@cmeiklejohn did you use :platforms option on the master or with 0.11.1

thomasbalsloev commented 11 years ago

Got this error on Linux Mint 13 (3.2.0-23-generic) 64bit:

Building native extensions. This could take a while... ERROR: Error installing therubyracer: ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb

checking for main() in -lpthread... yes creating Makefile

make compiling heap.cc compiling trycatch.cc compiling init.cc compiling locker.cc compiling template.cc compiling gc.cc compiling constraints.cc compiling context.cc compiling invocation.cc compiling stack.cc compiling date.cc compiling message.cc compiling handles.cc compiling array.cc compiling signature.cc compiling exception.cc compiling rr.cc compiling accessor.cc compiling primitive.cc compiling string.cc compiling v8.cc compiling object.cc compiling function.cc compiling constants.cc compiling value.cc compiling backref.cc compiling external.cc compiling script.cc linking shared-object v8/init.so /var/lib/gems/1.9.1/gems/libv8-3.11.8.11-x86_64-linux/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Malformed archive collect2: ld returned 1 exit status make: *\ [init.so] Error 1

Gem files will remain installed in /var/lib/gems/1.9.1/gems/therubyracer-0.11.1 for inspection. Results logged to /var/lib/gems/1.9.1/gems/therubyracer-0.11.1/ext/v8/gem_make.out

I was able to solve it by using libv8 version 3.11.8.4 together with therubyracer version 0.11.0:

gem 'libv8', '= 3.11.8.4' gem "therubyracer", '= 0.11.0', :platforms => :ruby

Hope this helps someone...

Cheers Thomas. Panorama9

shida commented 11 years ago

I could install with:

  gem 'libv8', :platform => :ruby
  gem 'therubyracer', :platforms => :ruby

If without libv8 line, libv8 gem was installed but libv8 native extenstion was not build, so therubyracer's build is faild.

dyoung522 commented 11 years ago
Even with the :platform => :ruby line I can't get it to compile
  * 2013-01-09 09:28:28 executing `bundle:install'
  * executing "cd /var/www/staging/releases/20130109142827 && bundle install --gemfile /var/www/staging/releases/20130109142827/Gemfile --path /var/www/staging/shared/bundle --deployment --quiet --without development test"
    servers: ["**IP-ADDRESS-REMOVED**"]
    [**IP-ADDRESS-REMOVED**] executing command
 ** [out :: **IP-ADDRESS-REMOVED**] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] checking for main() in -lpthread... yes
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] creating Makefile
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] make
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling handles.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling external.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling trycatch.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling accessor.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling value.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling init.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling template.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling constants.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling v8.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling date.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling stack.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling array.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling constraints.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling primitive.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling function.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling object.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling gc.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling locker.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling backref.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling invocation.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling rr.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling context.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling script.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling exception.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling message.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling string.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling heap.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] compiling signature.cc
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] linking shared-object v8/init.so
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] /var/www/staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.11-x86-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Malformed archive
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] collect2: ld returned 1 exit status
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] make: *** [init.so] Error 1
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] Gem files will remain installed in /var/www/staging/shared/bundle/ruby/1.9.1/gems/therubyracer-0.11.1 for inspection.
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] Results logged to /var/www/staging/shared/bundle/ruby/1.9.1/gems/therubyracer-0.11.1/ext/v8/gem_make.out
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] An error occurred while installing therubyracer (0.11.1), and Bundler cannot continue.
 ** [out :: **IP-ADDRESS-REMOVED**] 
 ** [out :: **IP-ADDRESS-REMOVED**] Make sure that `gem install therubyracer -v '0.11.1'` succeeds before bundling.
 ** [out :: **IP-ADDRESS-REMOVED**] 
    command finished in 50384ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/staging/releases/20130109142827; true"
    servers: ["**IP-ADDRESS-REMOVED**"]
    [**IP-ADDRESS-REMOVED**] executing command
    command finished in 1301ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '1.9.3-p194' -c 'cd /var/www/staging/releases/20130109142827 && bundle install --gemfile /var/www/staging/releases/20130109142827/Gemfile --path /var/www/staging/shared/bundle --deployment --quiet --without development test'" on **IP-ADDRESS-REMOVED**
passenger@web01:~/website$ cat /var/www/staging/shared/bundle/ruby/1.9.1/gems/therubyracer-0.11.1/ext/v8/gem_make.out
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
creating Makefile
make
compiling handles.cc
compiling external.cc
compiling trycatch.cc
compiling accessor.cc
compiling value.cc
compiling init.cc
compiling template.cc
compiling constants.cc
compiling v8.cc
compiling date.cc
compiling stack.cc
compiling array.cc
compiling constraints.cc
compiling primitive.cc
compiling function.cc
compiling object.cc
compiling gc.cc
compiling locker.cc
compiling backref.cc
compiling invocation.cc
compiling rr.cc
compiling context.cc
compiling script.cc
compiling exception.cc
compiling message.cc
compiling string.cc
compiling heap.cc
compiling signature.cc
linking shared-object v8/init.so
/var/www/staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.11-x86-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Malformed archive
collect2: ld returned 1 exit status
make: *** [init.so] Error 1
passenger@web01:~/website$ cat Gemfile
source 'https://rubygems.org'
gem 'rails', '~> 3.2' # Don't upgrade to rails 4
gem 'jquery-rails', '~> 2.1'
gem 'bcrypt-ruby'
gem 'faker'
gem 'omniauth-google-apps'
gem 'mootools-rails'
gem 'simple_form'
gem 'gmaps4rails'
gem 'kaminari'
gem 'coffee-rails'
gem 'haml'
gem 'oily_png'
gem 'cancan'
gem 'seedbank'
gem 'hirb', group: [:development, :staging]
gem 'rvm-capistrano', group: :development
gem 'hirb', group: [:development, :staging]
gem 'mysql2', group: [:development, :staging, :production]
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'compass-rails'
  gem 'compass-colors'
  gem 'sassy-buttons'
  gem 'sass-rails'
  gem 'uglifier'
end
group :test, :development do
  gem 'rspec-rails'
  gem 'guard-rspec'
  gem 'guard-spork'
  gem 'spork'
  gem 'thin'
end
group :test do
  gem 'sqlite3'
  gem 'capybara'
  gem 'rb-fsevent', :require => false
  gem 'growl'
  gem 'factory_girl_rails'
  gem 'cucumber-rails', :require => false
  gem 'database_cleaner'
end
# Provides JavaScript Runtime
group :staging, :production do
  gem 'libv8', :platform => :ruby
  gem 'therubyracer', :platform => :ruby
end
passenger@web01:~/website$ uname -a
Linux web01 3.2.0-35-virtual #55-Ubuntu SMP Wed Dec 5 18:25:01 UTC 2012 i686 i686 i386 GNU/Linux
shida commented 11 years ago

My result is :

$ uname -a Linux rabbit 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

My machine is 64bit CPU.

dyoung522 commented 11 years ago

FWIW: I'm running in an ECU instance on Amazon S3

dyoung522 commented 11 years ago

Note: Dropping back to an older version, as suggested by Pranas, got me back up and running, but the latest version won't install via deployment.

cowboyd commented 11 years ago

The problem folks are having and why you have to put ':platforms => :ruby' in your Gemfiles is a continued use of the binary gems for x86 and x86_64.

You can see in the failure lines when it tries to link

libv8-3.11.8.11-x86-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Malformed archive
collect2: ld returned 1 exit status

See how the directory for the gem is libv8-3.11.8.11-x86-linux and not just plain old libv8-3.11.8.11 ? specifying the :ruby platform forces it to choose the the source version of the gem and no the binary.

It is puzzling however that this is necessary, because when I became aware of the problem 5 days ago, I yanked all of the binary linux gems from rubygems.org. Yet it still appears to be serving them. I don't know if this is a problem with rubygems, bundler, or perhaps a caching problem in the gem distribution network.

cowboyd commented 11 years ago

Also, please make sure that the bad binary gem is removed from all of your local gem caches.

dyoung522 commented 11 years ago

Still can't get it to work.

Remove all deployed gems:

passenger@web01:~/website$ rm -rf /var/www/staging/shared/bundle

Verify only the non-binary gem is installed in this gemset:

passenger@web01:~/website$ gem list libv8
*** LOCAL GEMS ***
libv8 (3.11.8.11)

Re-try the deployment install:

passenger@web01:~/website$ bundle install --deployment --path /var/www/staging/shared/bundle --gemfile ./Gemfile --without development test
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.3) 
Installing i18n (0.6.1) 
Installing multi_json (1.5.0) 
Installing activesupport (3.2.11) 
Installing builder (3.0.4) 
Installing activemodel (3.2.11) 
Installing erubis (2.7.0) 
Installing journey (1.0.4) 
Installing rack (1.4.3) 
Installing rack-cache (1.2) 
Installing rack-test (0.6.2) 
Installing hike (1.2.1) 
Installing tilt (1.3.3) 
Installing sprockets (2.2.2) 
Installing actionpack (3.2.11) 
Installing mime-types (1.19) 
Installing polyglot (0.3.3) 
Installing treetop (1.4.12) 
Installing mail (2.4.4) 
Installing actionmailer (3.2.11) 
Installing arel (3.0.2) 
Installing tzinfo (0.3.35) 
Installing activerecord (3.2.11) 
Installing activeresource (3.2.11) 
Installing bcrypt-ruby (3.0.1) with native extensions 
Installing cancan (1.6.8) 
Installing chunky_png (1.2.7) 
Installing coffee-script-source (1.4.0) 
Installing execjs (1.4.0) 
Installing coffee-script (2.2.0) 
Installing rack-ssl (1.3.2) 
Installing json (1.7.6) with native extensions 
Installing rdoc (3.12) 
Installing thor (0.16.0) 
Installing railties (3.2.11) 
Installing coffee-rails (3.2.2) 
Installing fssm (0.2.9) 
Installing sass (3.2.5) 
Installing compass (0.12.2) 
Installing compass-colors (0.9.0) 
Installing compass-rails (1.0.3) 
Installing faker (1.1.2) 
Installing gmaps4rails (1.5.6) 
Installing haml (3.1.7) 
Installing hashie (1.2.0) 
Installing hirb (0.7.0) 
Installing jquery-rails (2.1.4) 
Installing kaminari (0.14.1) 
Installing libv8 (3.11.8.11) 
Installing mootools-rails (1.0.1) 
Installing mysql2 (0.3.11) with native extensions 
Installing oily_png (1.0.2) with native extensions 
Installing omniauth (1.1.1) 
Installing ruby-openid (2.2.2) 
Installing rack-openid (1.3.1) 
Installing omniauth-openid (1.0.1) 
Installing ruby-openid-apps-discovery (1.2.0) 
Installing omniauth-google-apps (0.0.2) 
Using bundler (1.2.3) 
Installing rails (3.2.11) 
Installing ref (1.0.2) 
Installing sass-rails (3.2.5) 
Installing sassy-buttons (0.1.4) 
Installing seedbank (0.2.0) 
Installing simple_form (2.0.4) 
Installing therubyracer (0.11.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
        /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
creating Makefile
make
compiling handles.cc
compiling external.cc
compiling trycatch.cc
compiling accessor.cc
compiling value.cc
compiling init.cc
compiling template.cc
compiling constants.cc
compiling v8.cc
compiling date.cc
compiling stack.cc
compiling array.cc
compiling constraints.cc
compiling primitive.cc
compiling function.cc
compiling object.cc
compiling gc.cc
compiling locker.cc
compiling backref.cc
compiling invocation.cc
compiling rr.cc
compiling context.cc
compiling script.cc
compiling exception.cc
compiling message.cc
compiling string.cc
compiling heap.cc
compiling signature.cc
linking shared-object v8/init.so
/var/www/staging/shared/bundle/ruby/1.9.1/gems/libv8-3.11.8.11-x86-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Malformed archive
collect2: ld returned 1 exit status
make: *** [init.so] Error 1
Gem files will remain installed in /var/www/staging/shared/bundle/ruby/1.9.1/gems/therubyracer-0.11.1 for inspection.
Results logged to /var/www/staging/shared/bundle/ruby/1.9.1/gems/therubyracer-0.11.1/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.11.1), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.11.1'` succeeds before bundling.

What am I missing?

cowboyd commented 11 years ago

@dyoung522 you're still getting a copy of the corrupted gem (which rubygems should not be serving at all) :/

Are you pulling directly from rubygems or do you have an intermediate service that could be caching? This might be a problem with rubygems.

cmeiklejohn commented 11 years ago

Make sure you gem uninstall all versions.

dyoung522 commented 11 years ago

Yes, I'm pulling directly from rubygems.org and the only version of libv8 installed should be the ruby version -- I've uninstalled all the others (or so I thought).

I only have two gemsets on this server, (default) and global. Default is what I use and global only has the rudimentary gems installed (see below)

passenger@web01:~/website$ rvm gemset list
gemsets for ruby-1.9.3-p194 (found in /usr/local/rvm/gems/ruby-1.9.3-p194)
=> (default)
   global
passenger@web01:~/website$ rvm gemset use global
Using ruby-1.9.3-p194 with gemset global
passenger@web01:~/website$ gem list
*** LOCAL GEMS ***
bundler (1.2.0)
rake (0.9.2.2)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)
passenger@web01:~/website$ 

I realize it's looking to the -x86-linux version of the gem from somewhere, but I'm at a loss as to where it's getting it from or why.

dyoung522 commented 11 years ago

Hmmm... here's an interesting sidenote: If I do

bundle install --no-deployment
it installs without problem, but with the --deployment flag and --path set, it does not.

This leads me to believe the problem is within my configuration somewhere. :-/

cmeiklejohn commented 11 years ago

Maybe you could gist your Gemfile?

dyoung522 commented 11 years ago

I pasted it in my comments above. :-)

dyoung522 commented 11 years ago

for sake of brevity: https://gist.github.com/4494645