TalkingQuickly's Today I Learned

Installing old versions of therubyracer Gem

If working with a codebase which relies on an old version of therubyracer gem (in my case 0.9.9) there are likely to be lots of errors building native extensions.

This can be worked around by using an old Apple GCC version temporarily as follows:

brew install homebrew/dupes/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

And then running bundle as usual. This will also resolve issues with old versions of twitter-bootstrap-rails failing to installing (in my case 2.0.3).

Looking for help? Hashrocket provides expert Ruby on Rails development. We’ve built hundreds of high–quality Ruby on Rails applications over the past decade. Contact us today and find out how we can help you.