How to Fix Libv8 Error from Gemfile on Mavericks

How to fix libv8 error from Gemfile on Mavericks?

You can actually install that version on Mavericks:

gem install libv8 -v 3.11.8.17 -- --with-system-v8

I can confirm this works with rbenv and ruby 1.9.3p448

See a similar thread here Installing libv8 gem on OS X 10.9+

Fix therubyracer/libv8 (0.12.1) installation on Mavericks

OK, so this is now sorted.

For future people with the same problem, I was suffering from having ruby built against a previous installation of OS X.

Fixed by completely nuking rvm and starting from scratch, though I imagine you could just uninstall/reinstall the offending ruby.

More details on how the problem was solved here:

https://github.com/cowboyd/libv8/issues/120

bundle install / update: libv8 (therubyracer) installation fails (with native extensions)

Try that one for a little while:

gem 'therubyracer'
gem 'libv8', '3.16.14.3'

Should help.

Also it's better with a new bundler: gem install bundler --pre

bundle install libv8 keeps loading for ages

So the problem was that I was running ruby-1.8.7

And the solution: How do I install the libv8 ruby gem on a fresh Mountain Lion install?

gem install therubyracer -v '0.10.2' on osx mavericks not installing

If you decide to use a newer therubyracer gem version, you will no longer have this problem

Otherwise:

brew tap homebrew/dupes # Thanks Tom
brew install apple-gcc42

export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2

brew uninstall v8

gem uninstall libv8

gem install therubyracer -v '0.10.2' # specify version

Installing libv8 gem on OS X 10.9+

This is due to the fact that OS X 10.9+ is using version 4.8 of GCC. This is not supported officially in older versions of libv8 as mentioned in the pull request (https://github.com/cowboyd/libv8/pull/95). Please try bumping up the version of libv8 in your Gemfile (or) a bundle update should suffice.

From the libv8 README

Bring your own V8

Because libv8 is the interface for the V8 engine used by therubyracer, you may need to use libv8, even if you have V8 installed already. If you wish to use your own V8 installation, rather than have it built for you, use the --with-system-v8 option.

Using RubyGems:

gem install libv8 [-v YOUR_VERSION] -- --with-system-v8

Using Bundler (in your Gemfile):

bundle config build.libv8 --with-system-v8

Please note that if you intend to run your own V8, you must install both V8 and its headers (found in libv8-dev for Debian distros).

Bring your own compiler

You can specify a compiler of your choice by either setting the CXX environment variable before compilation, or by adding the --with-cxx= option to the bundle configuration:

bundle config build.libv8 --with-cxx=clang++

Edit:

If this issue is brought on by therubyracer, try the following as suggested by rider_on_rails here:

gem uninstall libv8

gem install therubyracer -v YOUR_RUBY_RACER_VERSION

gem install libv8 -v YOUR_VERSION -- --with-system-v8

bundle install issue with libv8 and rails

I suspect this was because I had a 32/64 bit mismatch.

I solved this with the following:


$ irb
ruby-1.9.3-p0 :001 > `gem list`.each_line {|line| `sudo env ARCHFLAGS="-arch x86_64" gem install #{line.split.first}`


Related Topics



Leave a reply



Submit