Nokogiri won't let me bundle install in Rails
Asked Answered
O

2

13

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?

Optimist answered 22/8, 2014 at 2:26 Comment(4)
Have you tried gem install nokogiri -v '1.6.3.1? Without seeing more of the error message, it is impossible to tell you why it failed to install.Fredericksburg
yup, I don't get an error. I only get an error when I run 'bundle install'Optimist
does a gem list show it as installed?Fredericksburg
thanks for your help! finally stumbled onto the right thing, posted below -Optimist
O
35

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!

Optimist answered 22/8, 2014 at 2:53 Comment(1)
amazing. i never ever would have figured those steps out. free help like this on the internet makes the world a better place. you are a good netizenMetropolitan
M
0

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

Milesmilesian answered 3/12, 2017 at 10:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.