Failing to Install Nokogiri Gem

Bundle install error installing nokogiri (1.6.7.2). Gem installs but not for rails app

I fixed it, but it may be an unsatisfying answer. I went through all of the advice, installed various dependencies, changed various settings. Nothing seemed to work. Then I deleted the project folder and pulled it again from Github, reinstalled rvm, ran bundle install again and it all worked normally.

So what was the one thing that I was missing? I can't be sure. But I can say if nothing else works, create a new folder and download the project again and run bundle install.. after installing all dependencies / tools first of course, found here -> https://nokogiri.org/tutorials/installing_nokogiri.html

Unable to gem install nokogiri

I think the answer was staring us in the face, your version of nokogiri requires Ruby less than 2.3, and you're running ruby 2.3.

It seems you're not the only one with this issue: https://github.com/sparklemotion/nokogiri/issues/1456

nokogiri gem installation error

Finally, the problem was caused by nokogiri itself by shipping it's own libxml2 that's incompatible with some systems.

So to install nokogiri I had to tell it that it should use the system libraries.

I installed it manually by:

gem install nokogiri -v 1.6.2.1 -- --use-system-libraries

And it worked well. Other answers didn't solve it.

Failing to install Nokogiri gem

This works like a charm!

gem install nokogiri -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2

https://stackoverflow.com/a/24511149

Error installing Nokogiri gem

I fixed the problem by first using brew install libxml2 libxslt. I then had to download the old xcode-select developer tools from late October found here https://developer.apple.com/downloads/index.action#

After that, running sudo gem install nokogiri finally worked.



Related Topics



Leave a reply



Submit