o5ewia

Get rid of Nokogiri LibXML warning on OSX Lion

If you are a Rails developer on OSX Lion or Mountain Lion, you might have seen this:

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

This happens because the Lion system default libxml2 (loaded at bootstrap) is used, regardless of which libxml2 Nokogiri was built against.

To get rid of the warning, (re)install the Nokogiri gem with:

gem install nokogiri -- --with-xml2-dir=/usr --with-xslt-dir=/opt/local --with-iconv-dir=/opt/local

1 Response
Add your response

7516
Michele wedding square

Also, try moving gem 'nokogiri' in the Gemfile to the top (just below gem 'rails'), as per https://github.com/sparklemotion/nokogiri/issues/742#issuecomment-9082139

over 1 year ago ·