Install therubyracer gem on OSX 10.11 El Capitan
I still had issues with @xxjjnn's answer. The following answer from github resolved it. My current setup: El Capitan 10.11.4 and Xcode 7.3.
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
The answer provided on therubyracer
Github page worked for me:
brew tap homebrew/versions
brew install v8-315
brew link --force v8-315
gem install libv8 -- --with-system-v8
gem install therubyracer
- Install xcode through app store
- Install 'command line tools' for xcode (
xcode-select --install
) - If using rbenv, after installing ruby you needed
rbenv rehash
Assuming you have run
gem install bundler
and got errors, remove your mess:gem uninstall libv8 gem uninstall therubyracer brew rm v8
Install gcc4.2
brew tap homebrew/dupes brew install apple-gcc42
Install v8
brew tap homebrew/versions brew install v8-315 brew link --force v8-315
Install gems
gem install libv8 -- --with-system-v8 gem install therubyracer
if you get
dyld: lazy symbol binding failed: Symbol not found
, @rpbaltazar suggests an alternative:bundle config --local build.libv8 --with-cxx=/usr/local/bin/g++-4.2 bundle install