How to fix “An error occurred while installing nokogiri (1.6.2.1)”

by lifeLinux on May 29, 2014

Today, When I’m running bundle install and I’m having this error

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri 1.6.2.1/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.


I try to run command

gem install nokogiri -v '1.6.2.1'

I also have installed nokogiri succeed, When I run

gem list

I have

nokogiri (1.6.2.1)

But when running bundle install it continues saying that.
And , I found a solution to solve it. I use the system library instead, I reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries

After, I rebuild Bundle succeed

Leave a Comment

Previous post:

Next post: