efp3xg
Last Updated: February 25, 2016
·
5.14K
· gabebw

Fix those Nokogiri libxml version mismatch errors

I see these errors a lot:

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

Here's how to fix them:

# Mercilessly nuke every Nokogiri version
$ gem uninstall nokogiri --all --force --executables 
# These arguments will be passed to `gem install nokogiri`
$ bundle config build.nokogiri -- --with-xml2-include=`brew --prefix libxml2`/include/libxml2 --with-xml2-lib=`brew --prefix libxml2`/lib --with-xslt-dir=`brew --prefix libxslt`
# Reinstall
$ bundle install

You'll need to do this every time you install a new version of libxml.

4 Responses
Add your response

12303

this is great :)

over 1 year ago ·
12645

Thank you Gabe

over 1 year ago ·
12696

Great!

over 1 year ago ·
16218

I've put together a ruby script as a gist which does something similar.

over 1 year ago ·