rubyjs / therubyracer

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

Doesn't install into MRI 1.9.3 #126

Closed drnic closed 12 years ago

drnic commented 12 years ago
Installing therubyracer (0.9.9) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/drnic/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb 
checking for main() in -lobjc... yes
creating Makefile

make
compiling rr.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
rr.cpp: In function ‘VALUE rr_define_finalizer(VALUE, void*, VALUE)’:
rr.cpp:48: warning: no return statement in function returning non-void
rr.cpp: In function ‘v8::Handle<v8::Value> rr_rb2v8(VALUE)’:
rr.cpp:151: warning: implicit conversion shortens 64-bit value into a 32-bit value
rr.cpp: In function ‘VALUE rr_define_finalizer(VALUE, void*, VALUE)’:
rr.cpp:48: warning: control reaches end of non-void function
compiling v8.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_array.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_callbacks.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_context.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_date.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_debug.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_exception.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_exception.cpp:10: warning: ‘<unnamed>::stack’ defined but not used
compiling v8_external.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_external.cpp:10: warning: ‘<unnamed>::references’ defined but not used
compiling v8_function.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_handle.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_locker.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_locker.cpp: In function ‘VALUE<unnamed>::Lock::Delete(VALUE)’:
v8_locker.cpp:45: warning: no return statement in function returning non-void
v8_locker.cpp: In function ‘VALUE<unnamed>::Unlock::Delete(VALUE)’:
v8_locker.cpp:85: warning: no return statement in function returning non-void
v8_locker.cpp:85: warning: control reaches end of non-void function
v8_locker.cpp: In function ‘VALUE<unnamed>::Lock::Delete(VALUE)’:
v8_locker.cpp:45: warning: control reaches end of non-void function
compiling v8_message.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_object.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_script.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_string.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_string.cpp: In function ‘VALUE<unnamed>::New(VALUE, VALUE)’:
v8_string.cpp:18: warning: implicit conversion shortens 64-bit value into a 32-bit value
v8_string.cpp: In function ‘VALUE<unnamed>::NewSymbol(VALUE, VALUE)’:
v8_string.cpp:23: warning: implicit conversion shortens 64-bit value into a 32-bit value
compiling v8_template.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_try_catch.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_v8.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_v8.cpp: In function ‘VALUE<unnamed>::SetFlagsFromString(VALUE, VALUE)’:
v8_v8.cpp:22: warning: implicit conversion shortens 64-bit value into a 32-bit value
compiling v8_value.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_weakref.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
linking shared-object v8.bundle
ld: library not found for -lv8
collect2: ld returned 1 exit status
make: *** [v8.bundle] Error 1
drnic commented 12 years ago

I'm on Lion OS/X

oparoz commented 12 years ago

Same problem on FreeBSD.

g++46 -shared -o v8.so v8_value.o v8_locker.o v8_weakref.o v8_script.o v8_template.o v8_object.o v8_callbacks.o rr.o v8_context.o v8_array.o v8_string.o v8ms/libv8-3.3.10.2/lib/libv8/build/v8 -Wl,-R/usr/local/rvm/gems/ruby-1.9.2-p290@rails3/gems/libv8-3.3.10.2/lib/libv8/build/v8 -L. -L/usr/local/rvm/rubies/rucal/rvm/rubies/ruby-1.9.2-p290/lib -lruby  -lthr -lrt -lcrypt -lm   -lc -lv8 -lpthread
/usr/local/bin/ld: error: cannot find -lv8

ldconfig knows v8 though:

        357:-lv8.1 => /usr/local/lib/libv8.so.1

but V8 was compiled after Ruby was, if it makes any difference...

jeffmueller commented 12 years ago

I'm getting the exact same output as drnic, but I'm using Ruby 1.9.3 on Lion and attempting to install v0.9.8 of the gem.

cowboyd commented 12 years ago

There is a binary version of libv8 for Lion now, so this issue should be resolved. To compile therubyracer with clang(which is the default for 1.9.3 on Lion), you will need version 0.9.9

cowboyd commented 12 years ago

Note that you may need to uninstall libv8

drnic commented 12 years ago

Success!

$ gem uninstall libv8
Successfully uninstalled libv8-3.3.10.2
$ gem install libv8
Fetching: libv8-3.3.10.3-x86_64-darwin-11.gem (100%)
Successfully installed libv8-3.3.10.3-x86_64-darwin-11
1 gem installed
$ gem install therubyracer
Building native extensions.  This could take a while...
Successfully installed therubyracer-0.9.9
1 gem installed
oparoz commented 12 years ago

This doesn't fix the problem on FreeBSD...

zakim commented 12 years ago

This doesn't fix the problem on Ubuntu,

$ gem install libv8 Fetching: libv8-3.3.10.2-x86-linux.gem (100%) Successfully installed libv8-3.3.10.2-x86-linux 1 gem installed Installing ri documentation for libv8-3.3.10.2-x86-linux... Installing RDoc documentation for libv8-3.3.10.2-x86-linux... $ gem install therubyracer Could not find libv8-3.3.10.3 in any of the sources

cowboyd commented 12 years ago

Could not find libv8-3.3.10.3 in any of the sources

That version of the gem does not exist.

secretariat commented 12 years ago

I have the same problem!!! my OS CentOS how to fix the problem with incorrect version of this gem "libv8-3.3.10.2-x86-linux"?

gem install libv8 -v 3.3.10.3 ERROR: Could not find a valid gem 'libv8' (= 3.3.10.3), here is why: Found libv8 (3.3.10.3), but was for platform x86_64-darwin-11 ERROR: Possible alternatives: libv8

Limb commented 12 years ago

Having the same issue on Snow Leopard, Ruby 1.9.2

cowboyd commented 12 years ago

don't use libv8 -v 3.3.10.3

It only exists for Lion, and no other platforms.

Instead, please let rubygems automatically select the gem version for you. For example, on Snow Leopard:

legolas:~ cowboyd$ gem install therubyracer
Fetching: libv8-3.3.10.2-x86_64-darwin-10.gem (100%)
Fetching: therubyracer-0.9.9.gem (100%)
Building native extensions.  This could take a while...
Successfully installed libv8-3.3.10.2-x86_64-darwin-10
Successfully installed therubyracer-0.9.9
2 gems installed
Installing ri documentation for libv8-3.3.10.2-x86_64-darwin-10...
Installing ri documentation for therubyracer-0.9.9...
Installing RDoc documentation for libv8-3.3.10.2-x86_64-darwin-10...
Installing RDoc documentation for therubyracer-0.9.9...
Limb commented 12 years ago

Running 'bundle install' is throwing 'Could not find libv8-3.3.10.3 in any of the sources'. Manually installing with 'gem install therubyracer' works fine. Which I assume makes this a bundler issue.

secretariat commented 12 years ago

the same problem: gem install therubyracer Successfully installed therubyracer-0.9.9 1 gem installed Installing ri documentation for therubyracer-0.9.9... Installing RDoc documentation for therubyracer-0.9.9...

Running 'bundle install' is throwing 'Could not find libv8-3.3.10.3 in any of the sources'

any solutions?

cowboyd commented 12 years ago

try removing your Gemfile.lock, and rebundling.

If that doesn't work, then it probably is a bundle issue. Blech. Which version of bundler are you guys using, and is it an issue with bundler 1.1?

The obvious workaround would be to explicitly put libv8-3.3.10.2 in your Gemfile.

Limb commented 12 years ago

Tried that. Reset all of Bundlers files as well. It appears to be an issue with bundler getting confused due to the release of 10.3 for darwin-11 only. Changing s.add_dependency "libv8", "~> 3.3.10" to s.add_dependency "libv8", "3.3.10.2" in therubyracer.gemspec should fix it. EDIT: Though this would bring back the issue for Lion and V8, did not think that all the way through.

secretariat commented 12 years ago

add this lines to yours gemfile gem 'execjs' gem 'therubyracer', :platforms => :ruby

bundle install

and it works on CentOs!!!!

Thank you all!!!

jasonkemm commented 12 years ago

CentOS5, not working.

tried this --> add this lines to yours gemfile gem 'execjs' gem 'therubyracer', :platform => :ruby

bundle install

nope:

bundle install You passed :platform as an option for gem 'therubyracer', but it is invalid.

tried installing libv8 first, correct version of libv8 installs, but still cannot run bundle install.

sh-3.2$ bundle install Updating git://github.com/nathancolgate/s3-swf-upload-plugin Fetching source index for http://rubygems.org/ Could not find libv8-3.3.10.3 in any of the sources

Is this really worth making run on OSX Lion Server when it breaks everyone else? Maybe do a release of libv8-3.3.10.3 for everyone else with no changes???? at least get all the versions the same, then there will be no bundle issues.

secretariat commented 12 years ago

sorry, the correct option name looks like

"gem 'therubyracer', :platformS => :ruby" - fixed in me post

I have installed libv8-3.3.10.2 gem install libv8 gem install therubyracer bundle install it works fine, I've just generated new project and working with it)))

cowboyd commented 12 years ago

@jasonkemm Of course it is not worth it to break everybody for the sake of Lion. Unfortunately, we did not foresee this bug in Bundler. While we consider the best solution, please consider an explicit dependency on libv8-3.3.10.2 to your Gemfile as a workaround.

Limb commented 12 years ago

Specifying gem 'libv8', '3.3.10.2' in the Gemfile seems to do the trick to get around the error as well.

cowboyd commented 12 years ago

The Bundler Issue has been reported here https://github.com/carlhuda/bundler/issues/1537

In the meantime we've had to yank the Lion binary so as not to break everybody else's Gemfile's.

Expect an across the board release of 3.3.10.4 tomorrow.

cowboyd commented 12 years ago

just release libv8-3.3.10.4 across the board, so bundler should be happy.

oparoz commented 12 years ago

This doesn't solve the problem on FreeBSD, but it seems to be a libv8 problem, so I'm going to report it there :)

shamshul2007 commented 11 years ago

facing the issue that i am not able to execute ROR app OS:Ubuntu Ruby:1.9.3 following is the output when i run bundle

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb 

* extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby1.9.1 extconf.rb:15:in <main>': undefined methodinclude_path' for Libv8:Module (NoMethodError)

Gem files will remain installed in /home/sham/.bundler/tmp/2981/gems/therubyracer-0.9.9 for inspection. Results logged to /home/sham/.bundler/tmp/2981/gems/therubyracer-0.9.9/ext/v8/gem_make.out

An error occurred while installing therubyracer (0.9.9), and Bundler cannot continue. Make sure that gem install therubyracer -v '0.9.9' succeeds before bundling.

ignisf commented 11 years ago

Try updating therubyracer

shamshul2007 commented 11 years ago

Already did it is not working for me

cameronleake commented 11 years ago

Uninstalling libv8 allowed therubyracer -v '0.9.9' to compile on my machine: