Read more

Installing therubyracer and libv8 with Ruby 1.8 on OSX Mavericks

Dominik Schöler
January 13, 2014Software engineer at makandra GmbH

There seems to be no way to use therubyracer -v '0.11.4' and libv8 -v '3.11.8.17' on OS X Mavericks.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

However, running bundle update therubyracer worked for me. It installed therubyracer -v '0.12.1' and libv8 -v '3.16.14.3' and I had not side effects.


Log of my attempts to get it working

Probably you got here when bundling failed building native extensions for therubyracer.

The libv8 (3.3.10.4) should have been installed when bundling. Unfortunately it is not building correctly on Mavericks, so the libv8.a file that therubyracer needed is never created. We'll first install v8 via brew and then symlink the required file into the gem:

brew install v8

# select the right version of <RUBY> and <LIBV8>
ln -s /usr/local/Cellar/v8/3.21.17/lib/libv8_base.x64.a ~/.rvm/gems/<RUBY>/gems/<LIBV8>/lib/libv8/build/v8/libv8.a

There are solutions proposing exporting environment variables like CC, but I found that old versions of libv8 were not using it Show archive.org snapshot .

I'm still getting LoadError: dlopen(/Users/makandra/.rvm/gems/ruby-1.8.7-p374/gems/therubyracer-0.9.9/ext/v8/v8.bundle, 9): Symbol not found: __ZN2v88internal8Snapshot13context_size_E

Helpful threads on this topic

Also see Installation of therubyracer fails with "undefined method `include_path'"

Posted by Dominik Schöler to makandra dev (2014-01-13 16:25)