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

Leave a Comment