Repeatedly failing to install on Mavericks… #120
Comments
No worries about posting an issue. What strikes me as strangest is that there is a binary gem for Mavericks, so you should not have to compile it at all. Here is what it looks like on my machine:
So the compiler shouldst need never get involved. Here is the output of the following on my mavericks box.
What happens when you run the above commands from a clean gemset? |
Hey, Thanks for the help. Agree with what you’re saying, in my (limited) understanding, my problem doesn’t "make sense", because of how libv8 actually works! I ran the above command:
:/ |
Your Ruby version has been compiled on an older version of MacOS. This causes RUBY_PLATFORM to indicate darwin10. A workaround is to recompile Ruby. |
Yes. As @ignisf indicates, my first line of attack would be to re-install/re-compile ruby. |
Cool, thanks. At a guess, do you think it’s probably worth imploding rvm and starting from scratch? "Nuke the entire site from orbit – it's the only way to be sure" |
If this is indeed your problem, then you will probably save yourself some trouble down the road by doing so. If this fixed your issue, I'm going to go ahead and mark this closed. |
Works a treat. Thank you so much. |
Hey folks-- I'm having the same issue here and starting to get stumped. Upgraded to Mavericks, reinstalled ruby via RVM, and now I can't manage to install libv8. I've tried the above suggestions, and everything looks right, but it's still trying to compile the extension rather than download and use the binary gem. Here's what I get
As you can see, the ruby for this project is REE. Would that keep it from using the binary gem? It was news to me that binary gems even existed, and I'm having trouble finding documentation about them, so any pointers in that direction would be most welcome too. |
Hello @rrosen, You could try to use the current HEAD version, as explained here https://github.com/cowboyd/libv8#using-a-git-version. It should compile on Mavericks. |
I'm having the same problem (also with REE on Mavericks), and the recommended solution is not working for me. I added the following to my Gemfile...
... and this is what I got when trying
I think I'm going to have to install Vagrant now in order to keep doing work on this project. |
I ran into this problem as well with
Note I used a relative path up there so you may have adjust for that and the actual version of ruby you're using. |
@stevecj I don't know why |
@jmangs can you gem install libv8? If so, I find it very odd that it would not use that installation for that same version of ruby. |
Thanks for the tips @ignisf I was just using therubyracer for rails asset pipeline functionality, so I wound up replacing it with execjs and node intalled via homebrew. |
@cowboyd should we add REE to travis? |
I think so. We should probably keep it in sync with the builds for the |
This still appears to be an issue using: tl;dr libv8 is still trying to compile even though I am supposedly on an supported platform. 2 days and still have not been able to resolve issue :( ruby -rubygems -e 'puts Gem::Platform.new(RUBY_PLATFORM)'
x86-darwin-13 gem install libv8 -v '3.16.14.1'
Fetching: libv8-3.16.14.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
/Users/cs/.rbenv/versions/1.8.7-p375/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
^
1 error generated.
make[1]: *** [/Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/ext/libv8/location.rb:36:in `verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/ext/libv8/location.rb:35:in `each'
from /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7
Using python 2.7.5
Using compiler: g++
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
-Dv8_target_arch=x64 \
-S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
CXX(target) /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target) /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target) /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
CXX(target) /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
CXX(target) /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o
Gem files will remain installed in /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1 for inspection.
Results logged to /Users/cs/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.1/ext/libv8/gem_make.out I also tried with gcc-4.8, different error but still does not install properly gem install libv8 -- --with-cxx=gcc-4.8
Building native extensions. This could take a while...
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
/Users/adam/.rbenv/versions/1.8.7-p375/bin/ruby extconf.rb --with-cxx=gcc-4.8
creating Makefile
Compiling v8 for x64
gcc-4.8: error: unrecognized command line option '-Wnewline-eof'
make[1]: *** [/Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o] Error 1
make: *** [x64.release] Error 2
/Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
from /Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7
Using python 2.7.5
Using compiler: /usr/local/bin/gcc-4.8
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
-Dv8_target_arch=x64 \
-S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
CXX(target) /Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
Gem files will remain installed in /Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3 for inspection.
Results logged to /Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/libv8-3.16.14.3/ext/libv8/gem_make.out libv8 would appear to install successfully if I install v8 via homebrew and specify with system v8 brew install v8
gem install libv8 -- --with-system-v8
=> Building native extensions. This could take a while...
Successfully installed libv8-3.16.14.3
1 gem installed
Installing ri documentation for libv8-3.16.14.3...
Installing RDoc documentation for libv8-3.16.14.3...
But does not really seem to work. therubyracer will fail on gem install therubyracer
Fetching: ref-1.0.5.gem (100%)
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.
/Users/adam/.rbenv/versions/1.8.7-p375/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
creating Makefile
make
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 -I. -I. -I/Users/adam/.rbenv/versions/1.8.7-p375/lib/ruby/1.8/i686-darwin13.1.0 -I. -I/Users/adam/.rbenv/versions/1.8.7-p375/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/adam/.rbenv/versions/1.8.7-p375/include -Wall -g -rdynamic -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -c accessor.cc
In file included from accessor.cc:1:
rr.h:463: error: ‘AccessorGetter’ in namespace ‘v8’ does not name a type
rr.h:464: error: ‘AccessorSetter’ in namespace ‘v8’ does not name a type
rr.h:466: error: ‘NamedPropertyGetter’ in namespace ‘v8’ does not name a type
..... (more like this) I have been able to reproduce this on multiple OSX 10.9.2, both with fresh OSX Mavericks installs. On both systems: ruby -rubygems -e 'puts Gem::Platform.new(RUBY_PLATFORM)'
x86-darwin-13
brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 637805eed563da9f7dac26f7f3887adc2add76c7
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
GCC-4.2: build 5666
Clang: 5.1 build 503
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/adam/.rbenv/shims/ruby Have been working on it for over 2 days now, will gladly help debug further / video pair. This is very painful. |
I'm having the same experience as @nelsonenzo. We install libv8
by adding the following into INCFLAGS on line 72 (adjust the path for whatever your usage of rvm, ruby version and libv8 installation location)
then cd to that directory and re-do the make:
The compile succeeds (with warnings) and I can go back to my application and I don't know why this magically works under Ruby 2.1. |
@rogermarlow Your workaround was going to be my last hope, but there is no Makefile file in my ~/.rvm/gems/ree-1.8.7-2012.02@310/gems/therubyracer-0.12.1/ext/v8 directory after trying to install. What now? Good excuse to finally upgrade the Ruby version for this project? I was hoping to actually try to actually work on delivering features again soon. Sigh :( |
Thanks @rogermarlow. I finally solved the problem by finally deciding to go ahead and upgrade the Ruby version on the project. It took me less than an hour, including fixing test failures. If I'd known it would go that smoothly, I'd have done that in the first place. Anyway, all is well now. I'm having no trouble installing any gems w/ Ruby 1.9.3. |
On the REE support -- my personal opinion is that the libv8 gem does not need to strive for backwards compatibility with such an archaic AND unsupported version of Ruby. Please consider migrating to a newer version. |
@ignisf I agree. I had been looking for workarounds, not official support. Having finally managed to divest everything I work on of REE, I no longer need workarounds either. :) |
I'm having this issue on OS X 10.10 (Yosemite) pre-release as well. ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin14.0] This is a freshly built ruby, using xcode6-beta. |
This is happening for me too on |
this is also happening to me, 10.10 using rbenv and ruby-2.0.0-p247 |
Yep, hitting this on 10.10 as well. |
ditto. 10.10 r4 xcode beta 6 CLT tried 2.1.2 & 1.9.3 --update-- |
This worked for me: git clone https://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake clean build binary
gem install pkg/libv8-<compiled_version_number>.gem This answer was given on StackOverflow. |
@rogermarlow unfortunately that did not work for me, I still can't install the Gem, although the make now builds as you had suggested once including the V8 headers. My ruby version is 2.0.0-p353, and my libv8 gem (that compiled when using Here is what happens. make builds OK
gem install fails
Am I missing something? How can I ensure the gem uses the modified Makefile? The only viable option I can think of is to create my own version of the Gem and install it, which I will probably do now, but wondering if there was a better way |
@mattheworiordan it's a while ago now but I usually ask bundler to figure out what was already installed and what needed building, so my manual make process must have fooled bundler into thinking that gem was now installed and it skipped it and moved on to the others. So in short avoid gem install and use bundle install instead. |
Thanks @rogermarlow, but unfortunately that didn't work either :| |
Same Issue on 10.10 as @mattheworiordan :( |
Reinstalling ruby 2.1.2p95 and bundle install does not work for me. |
I'm having the same problem on 10.10 (Yosemite) and 1.9.3-p429 |
I can confirm that i had to compile the libv8 gem on Yosemite myself in order to make therubyracer working as per @ardation's last comment. Here's the binary of 3.16.14.3 that this resulted in. |
Just a quick note for those trying to install on Mavericks with REE. I'm not sure how well that would work for other versions, but it may be worth a try. Looking at @rogermarlow comment, I was able to get it working with (adapt path to gem): brew install libv8
gem install libv8 -v '3.16.14.3' -- --with-system-v8
CPATH=$HOME/.gem/ruby/1.8/gems/libv8-3.16.14.3/vendor/v8/include gem install therubyracer -v '0.12.1' |
Well, I spoke too fast. I now get
|
Having this issue in Yosemite as well. Fresh ruby |
I have the same issue as @rafaelrinaldi |
@johnfig I've managed to get it done:
It seems to be a |
@rafaelrinaldi maybe, there is an open issue rbenv/ruby-build#651,
|
I'm having this problem on Yosemite too. Is this the problem?
My Mavericks machine returns Will someone eventually upload a -14 gem binary? (the --with-system-v8 is not a good workaround because our entire team will have to do it... that won't be fun.) |
Dangit, I apologize. I didn't see #124. That solves my issue, everything's good here. |
@vyorkin That worked for me. Thanks! |
I had similar problem leading to therubyracer installation fail. I solved it with:
From here: http://github.com/cowboyd/therubyracer/issues/307 |
Tried everything: reinstalling rubies, nuking rvm, brew v8, --with-system-v8, cloning libv8 and trying to run rake install, downgrading command line tools to 6.2. Nothing helped. Luckily a version 6.4 of xcode arrived and bundle install just worked. sigh |
@ksarna The biggest problem was that developers on OSX should never have to compile libv8 ever because there is a binary gem for mavericks. It turned out to be an issue with rubygems, where a binary gem built with rubygems < 2.2 would not be selected by rubygems > 2.4. The 6.4 commandline tools are still incompatible with the version of v8 we use, but last night I released a new binary gem build with rubygems 2.4.2 which is selected correctly. Hopefully this resolves further issues. |
@cowboyd sounds good! Thanks for the info and your work. |
@calexicoz exactly the same issue here!
This is what I did, before starting the server.
System config: Any more information is required? |
+1 |
@jikkujose Same issue here
El Capitan |
Hey,
First up, a couple of caveats/apologies:
Basically, I can’t install libv8 (and consequently therubyracer) via bundler on OS X 10.9. I’ve tried lots of different approaches, and nothing seems to work. I’ve been running 10.9 for a while and not seen any problems, but this may be the first time I’ve needed to install libv8 since upgrading, my memory isn’t clear.
I documented the problem pretty comprehensively on Stack Overflow a couple of days ago, but no-one’s been able to help:
https://stackoverflow.com/questions/22481435/fix-therubyracer-libv8-0-12-1-installation-on-mavericks
If you’d like me to reproduce the description here or add any more details, not a problem, just let me know what you need.
Thanks,
Chris.
The text was updated successfully, but these errors were encountered: