Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib

I suggest you first uninstall Nokogiri using:

sudo gem uninstall nokogiri

Then install Nokogiri using rubygems:

gem install nokogiri

If that doesn’t work, there’s an open issue on Nokogiri to support libxml 2.9.0 and later. There’s a libxml2-2.9.1 branch that was started in preparation for the next release of libxml2.

Then try pulling from that branch in your Gemfile like this:

gem "nokogiri", github: "sparklemotion/nokogiri", branch: "libxml2-2.9.1"

or install an older version of libxml2.

If that still doesn’t work you may also want to try the suggestions here: What to do if libxml2 is being a jerk.

Leave a Comment