Trying to install therubyracer on mavericks using "gem install therubyracer -v '0.10.2'" but i am getting the following error:
/Users/dennischen/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for main() in -lobjc... yes
creating Makefile
make
compiling rr.cpp
clang: warning: argument unused during compilation: '-rdynamic'
rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling v8.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_array.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_callbacks.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_context.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_date.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_debug.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_exception.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_exception.cpp:10:16: warning: unused variable 'stack' [-Wunused-variable]
static void* stack[20];
^
1 warning generated.
compiling v8_external.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable]
VALUE references;
^
1 warning generated.
compiling v8_function.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_handle.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_locker.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_locker.cpp:45:5: warning: control reaches end of non-void function [-Wreturn-type]
}
^
v8_locker.cpp:85:5: warning: control reaches end of non-void function [-Wreturn-type]
}
^
2 warnings generated.
compiling v8_message.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_object.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_object.cpp:77:19: warning: unused variable 'proto' [-Wunused-variable]
Handle<Value> proto(rr_rb2v8(prototype));
^
1 warning generated.
compiling v8_script.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_string.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_template.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_try_catch.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_v8.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_value.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_value.cpp:100:9: warning: unused function 'ToInt32' [-Wunused-function]
VALUE ToInt32(VALUE self) {
^
1 warning generated.
compiling v8_weakref.cpp
clang: warning: argument unused during compilation: '-rdynamic'
linking shared-object v8.bundle
clang: error: no such file or directory: '/Users/dennischen/.rvm/gems/ruby-1.9.3-p194@panini/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a'
make: *** [v8.bundle] Error 1
can anyone help me figure out how to get this gem to work? I have the command line tools installed.
So I finally got it working after some struggling... thanks to Simon and Alvaro.
I have one thing to add though, using the flag --with-system-v8 did not work for me... So i removed my system v8 with
brew uninstall v8
And the run
gem install libv8
If you have already run
gem install libv8
with the system v8 flag be sure to uninstall that gem version (do it by runninggem uninstall libv8
). The important thing is that you shouldn't use the one provided by brew, it does not seem to work in Mavericks (it gets installed well and bundler will report that your bundle is complete, but your app will fail when it tries to use v8).To summarize the answer, doing the following worked for me:
I found a workaround that worked without installing apple-gcc42.
This will work if the error message you're getting looks like this:
Then you should be able to do the following:
Source: https://github.com/cowboyd/therubyracer/issues/277#issuecomment-27734348
I manage to install therubyracer 0.12 and libv8 3.16.14.3 on ruby 2.0.0p353 and os x 10.9
libv8 requires gcc42
therubyracer requires later gcc
Gemfile
use
bundle
instead ofgem install therubyracer
This should be a failsafe and clean way (no symlinks) to to install therubyracer for anyone having trouble.
Taken from: gem install therubyracer -v 0.11.4 fails on OS X 10.10
install Xcode (if you don't already have one of these versions) 6.1.1, 6.2-beta or 6.3-beta and (this one is needed) 4.6.3
gem uninstall libv8
if you haven't already done soswitch to Xcode 4.6.3
sudo xcode-select --switch /Applications/Xcode4.6.3.app/Contents/Developer
gem install libv8 -v '3.11.8.17'
Or whichever version is tied to your version of therubyracerswitch to Xcode 6.1.1, 6.2-beta or 6.3-beta (or if you want to try your current install of Xcode, adjust this line, I've confirmed all 3 of these work)
sudo xcode-select --switch /Applications/Xcode6.1.1.app/Contents/Developer
gem install therubyracer -v '0.11.4'
or the version you're trying to install.I had this problem after upgrading from Mavericks to Yosemite. The issue was that I compiled my Ruby version with the old version of OSX.
If I ran
ruby -rubygems -e 'puts Gem::Platform.new(RUBY_PLATFORM)'
I would get
x86_64-darwin-13
instead ofx86_64-darwin-14
for Yosemite.To re-install Ruby I
rvm remove ruby-2.1.1
rvm reinstall --disable-binary 2.1
Then I was able to run
bundle install
with no errors after trying all the solutions above.What I did was to on osx mavericks:
Then:
This procedure downloaded a binary version of libv8 and installed it.