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

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- for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri
An error occurred while installing nokogiri (, and Bundler cannot continue.
Make sure that `gem install nokogiri -v ''` succeeds before bundling.

I try to run command

gem install nokogiri -v ''

I also have installed nokogiri succeed, When I run

gem list

I have

nokogiri (

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: