rubyjs / therubyracer

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

can't install on gentoo #319

Closed h0i closed 8 months ago

h0i commented 9 years ago

Trying to install on gentoo box but I get the following errors:

gem install therubyracer Fetching: ref-1.0.5.gem (100%) Successfully installed ref-1.0.5 Fetching: libv8-3.16.14.7-x86_64-linux.gem (100%) Successfully installed libv8-3.16.14.7-x86_64-linux Fetching: therubyracer-0.12.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing therubyracer: ERROR: Failed to build gem native extension.

/kunden/dir/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb

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

make "DESTDIR=" clean

make "DESTDIR=" compiling constants.cc compiling heap.cc compiling accessor.cc compiling object.cc compiling array.cc compiling rr.cc compiling string.cc compiling date.cc compiling invocation.cc compiling value.cc compiling handles.cc compiling stack.cc compiling gc.cc compiling trycatch.cc compiling init.cc compiling backref.cc compiling locker.cc compiling exception.cc compiling function.cc compiling script.cc compiling external.cc compiling constraints.cc compiling template.cc compiling message.cc compiling signature.cc compiling v8.cc compiling primitive.cc compiling context.cc linking shared-object v8/init.so g++: /kunden/dir/.rvm/gems/ruby-2.1.2@project/gems/libv8-3.16.14.7-x86_64-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: No such file or directory g++: /kunden/dir/.rvm/gems/ruby-2.1.2@project/gems/libv8-3.16.14.7-x86_64-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a: No such file or directory

Any ideas?

Thanks!

ignisf commented 9 years ago

Can you paste the output of uname -a and the contents of the RUBY_PLATFORM constant?

h0i commented 9 years ago

uname -a Linux somehost.ispgateway.de 2.6.32.53-grsec-x86_64 #4 SMP Wed Jun 11 14:57:07 CEST 2014 x86_64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz GenuineIntel GNU/Linux

Hm, there is no environment variable like RUBY_PLATFORM. "rvm info" shows no such constant either. Where can I find this constant?

ignisf commented 9 years ago

It's a constant in Ruby. You can print it with this command ruby -e 'puts RUBY_PLATFORM'

h0i commented 9 years ago

$ ruby -e 'puts RUBY_PLATFORM' x86_64-linux

ignisf commented 9 years ago

Can I see the contents of RbConfig::MAKEFILE_CONFIG['build_cpu'], RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] and ['foo'].pack('p').size? Make sure you run it with the correct Ruby in RVM.

h0i commented 9 years ago

$ ruby -e "puts RbConfig::MAKEFILE_CONFIG['build_cpu']" x86_64 $ ruby -e "puts RbConfig::MAKEFILE_CONFIG['ARCH_FLAG']"

$ ruby -e "puts ['foo'].pack('p').size" 4 $ which ruby /kunden/somewhere/.rvm/rubies/ruby-2.1.2/bin/ruby

ARCH_FLAG returns nothing / seemes to be unset. What would be "the correct Ruby in RVM"? The one the gemset was created for?

Thanks!

ignisf commented 9 years ago

Oh wow... That's interesting... libv8 architecture detection fails due to the size of the pack being 4. I've opened the following issue in connection with this: https://github.com/cowboyd/libv8/issues/141

h0i commented 9 years ago

"g++ .../ia32.release/obj.target/..." sounded to me not sensible on an x86_64 machine but I don't now exactly. So I guess there is no workaround and I have to wait for the next release?

judgetr commented 9 years ago

i'm having the exact same issue, is there any update on this ?

ignisf commented 9 years ago

This will be fixed in libv8 4.5 by https://github.com/cowboyd/libv8/commit/3cbf1c3517ebd4aa447723713ee8ab2f542e14e9