Mountain Lion - Libxml & Nokogiri

Mountain Lion - LibXML & Nokogiri

Putting gem 'nokogiri' above gem 'pg' in my Gemfile fixed this for me.

My Gemfile didn't have nokogiri in it, but it was a dependency that was in Gemfile.lock, so I put it in my Gemfile explicitly.

WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8

I have found some fixes for Lion, but none for Mountain Lion yet. Nonetheless I have tried this and it works:

gem uninstall nokogiri libxml-ruby

brew update
brew uninstall libxml2
brew install libxml2 --with-xml2-config
brew link libxml2

brew install libxslt
brew link libxslt

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.8.0/include/libxml2/ --with-xml2-lib=/usr/local/Cellar/libxml2/2.8.0/lib/ --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26/

Source (for Lion): https://gist.github.com/1349681

troubles with nokogiri gem on mountain lion using bundler

You shouldn't be using sudo if you're using RVM or similar Ruby versions manager.

WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1

I also was getting this error frequently on OS X 10.9.1. This answer did the trick for me: https://stackoverflow.com/a/14658949/1769539

Or, to save you the trip - here's what worked for me, specifically:

"If you installed Nokogiri with bundle install, you can resolve this warning by running bundle exec gem pristine nokogiri and then 'bundle install'"

WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.6.16

In the end I had to install the gem against the specific versions of xml2 and xslt I have installed:

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
#. scrollbar line, so the code can be seen

The problem was most likely bad library management, switching between package managers without being tidy enough about it.



Related Topics



Leave a reply



Submit