Skip to content

Instantly share code, notes, and snippets.

@podlech
Last active November 1, 2016 11:02
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save podlech/837c7e5103c4cf5cb9b1 to your computer and use it in GitHub Desktop.
Save podlech/837c7e5103c4cf5cb9b1 to your computer and use it in GitHub Desktop.
OS X Yosemite ruby (1.9.3p484) libv8 (3.11.8.17) therubyracer (0.11.4)
brew install homebrew/dupes/apple-gcc42
rbenv install 1.9.3-p484
rbenv global 1.9.3-p484
git clone https://github.com/cowboyd/libv8.git
cd libv8
git checkout 3.11
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
bundle install
bundle exec rake clean build binary
gem install pkg/libv8-3.11.8.17.gem
gem install therubyracer -v '0.11.4'
@dennis-ba
Copy link

The only thing I would change would be to add a "bundle install" right before line 10.
Aside from that, this worked perfectly for ruby 1.9.3-p551 on OS X 10.10.1!
Thank you!

@podlech
Copy link
Author

podlech commented Feb 11, 2015

Thanks @dennis-ba! I'll add that line.

@renatorozas
Copy link

Works great, thanks @jpodlech.

@renatorozas
Copy link

@jpodlech This is only working with Bundler 1.8. I just tried this with Bundler 1.10 and it doesn't work, I'm getting this:

Your Gemfile requires gems that depend on each other, creating an infinite loop. Please remove gem 'rspec-spies' and try again.

The fix is easy, uninstall bundler 1.10 and install 1.8 like this:

gem uninstall bundler
gem install bundler -v 1.8
bundle install
...

@daveed
Copy link

daveed commented Sep 3, 2015

works perfectly - thanks @jpodlech

@arianf
Copy link

arianf commented Oct 11, 2015

This is how I got it working for me...

replace 3.16.14.7 with your version number.

bundle install
gem install libv8 -v '3.16.14.7' -- --with-system-v8

bundle install
gem uninstall libv8 -v '3.16.14.7' -- --with-system-v8

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
bundle install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment