Rails & Yosemite: Resolving libv8 and therubyracer Installation Problems
As a developer, upgrading to a new OS is always a task, especially when it comes to rails dependencies (surprisingly, Cocoa projects didn’t have as much of an issue with Yosemite).
I always wipe my machine and start fresh. This introduces a new class of problems, some of which I was able to mitigate this time around with mackup (a preference backup and restoration tool) and some upgrades to my dotfiles.
I customize bundler to work in parallel, store all gems for a given project in the vendor/ directory for that project, and to not use shared gems at all.LibV8 Compilation Issues
I ran into this error when bundler tried to install libv8 on Yosemite:Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I found a similar problem on StackOverflow, but my situation was a bit different because of my use of disable-shared-gemsif ! bundle show therubyracer; then bundle config build.libv8 --with-system-v8 gem install --install-dir vendor/bundle libv8 -v 22.214.171.124 gem install libv8 -v 126.96.36.199 gem install --install-dir vendor/bundle therubyracer fi
Update: It’s also important to lock down therubyracer and libv8 gems in your Gemfile:group :production do gem 'unicorn', '~> 4.8.3' gem 'libv8', '~> 188.8.131.52' gem 'therubyracer', '~> 0.12.1' end