Dani Fankhauser
Dani Fankhauser

Reputation: 651

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?

Upvotes: 13

Views: 7937

Answers (2)

Tarique
Tarique

Reputation: 4483

First try to do this sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev, then try to install

Upvotes: 0

Dani Fankhauser
Dani Fankhauser

Reputation: 651

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!

Upvotes: 35

Related Questions