Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nokogiri won't let me bundle install in Rails

I've seen this question asked and tried everything I've seen suggested.

I got a new macbook and am looking to set up an existing app. When i clone the app, it will not bundle install and acts like Rails is not installed, even though it works in other directories.

I tried removing version numbers from gemfile and deleting gemfile.lock. I tried bundle update. I'm on osx 10.9.4, rails 4.1.5 and ruby 2.1.1.

the error I am getting:

An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.

I have rvm installed. I tried reinstalling homebrew, rails and ruby.

What could it be?

like image 295
Dani Fankhauser Avatar asked Aug 22 '14 02:08

Dani Fankhauser


1 Answers

Ok, phew. This worked:

http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/

xcode-select --install
gem install nokogiri
bundle config build.nokogiri --use-system-libraries
bundle install

then, the pg gem wouldnt let bundle install. this fixed it - Installing PG gem on OS X - failure to build native extension

brew update
brew install postgresql
gem install pg

then... bundle install worked, finally, but rails s was giving me an error, which this fixed: Devise Secret Key was not set

just had to add the line w/the secret key to the config/initializers/devise.rb right before the last 'end'

hope this helps anyone who upgrades to Mavericks / gets a new computer that comes with it installed!

like image 168
Dani Fankhauser Avatar answered Sep 19 '22 17:09

Dani Fankhauser