-
Notifications
You must be signed in to change notification settings - Fork 193
Unable to compile therubyracer on Mountain Lion #181
Comments
The problem is that the version of v8 used by current release of therubyracer will not compile on Mountain Lion. Are you able to use the pre-release? |
I'm having the same issue and made a stackoverflow post about it here: |
@cowboyd libv8 does install successfully using 3.11.8.3 |
@cowboyd thanks, resolved using 3.11.8.3 as well. |
gem 'therubyracer', '0.11.0beta5' works fine for me |
I'm installed with those versions of therubyracer and libv8 however now I'm getting another issue that seems connected to this with twitter-bootstrap-rails. I posted an issue here: seyhunak/twitter-bootstrap-rails#321 |
I was able to get this working using |
I have the same problem as shwoodard. Starting the app fails with the following message:
|
@mysmallidea It looks like you are running ruby 1.8 and the binary gem was compiled with ruby 1.9. Right now therubyracer does not ship fat gems, so you will have to use the source. Rumour has it that @luislavena has a solution in the works for compiling a single binary gem for multiple versions of the binary interface. Until then, I would recommend installing the source version of the gem. |
I've run into a similar-but-different issue. Taking bundler out of the equation. Installed the libv8 gem (v 3.11.8.3) successfully. Next trying to install therubyracer gives:
Seems a bit weird to be a compiler error instead of a warning. Compiler info:
So it seems that Hacking away a bit, I was able to simply edit the Makefile in ext/v8/ and delete "-std=c89". Compilation worked well afterwards. I couldn't find references to "-std=c89" anywhere in therubyracer's sources, so I'm not sure how CPPFLAGS is assembled in that Makefile. Another easier solution was to explicitly use a different compiler:
Compiler info:
g++ (llvm-gcc) still doesn't like -std=c89, but it just produces a warning instead of an error, and the compilation/installation proceeds smoothly as seen above. The same trick applies when using bundler (in my case 'bundle' afterwards simply found the gem I had installed above, but I'd imagine without that step a simple These are, of course, hacks. I'm not sure how therubyracer can fix it in a permanent fashion (removing -std=c89 flag, or demanding compilation via llvm-gcc). |
@minaguib As you surmised the But these are all issue that really have to do with any c++ extension and not therubyracer in particular, since it does not ask for a specific c++ compiler only a c++ compiler. |
@minaguib Thanks! this fixed it. |
When I run bundle install this is what error I get:
Installing therubyracer (0.10.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
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::Handlev8::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: ‘::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: ‘::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::Lock::Delete(VALUE)’:
v8_locker.cpp:45: warning: no return statement in function returning non-void
v8_locker.cpp: In function ‘VALUE::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::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::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::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::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
i686-apple-darwin11-llvm-g++-4.2: /Users/Lily/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a: No such file or directory
make: *** [v8.bundle] Error 1
Gem files will remain installed in /Users/Lily/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.1 for inspection.
Results logged to /Users/Lily/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.1/ext/v8/gem_make.out
An error occured while installing therubyracer (0.10.1), and Bundler cannot continue.
Make sure that
gem install therubyracer -v '0.10.1'
succeeds before bundling.The text was updated successfully, but these errors were encountered: