Read more

Get rid of WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.7.8

Deleted user #6
September 27, 2012Software engineer

If you get this warning on your local machine one of these steps might help:

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Rebuilt the gem with the newer library

gem install --no-rdoc --no-ri nokogiri -- --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib

If you still get the error, try to uninstall all nokogiri versions with

gem uninstall nokogiri

and install nokogiri again.

Fixing the issue on servers

However, on our servers this probably will not work. On the server, gems are stored in the ../shared/bundle/ruby/:version/gems directory (relative to the current app directory).
If you do gem install in the current app directory, bundler will have no knowledge of this.

What you want to do instead is

bundle pristine nokogiri

and restart the application servers (e.g. b cap <environment> passenger:restart)

This should install the right nokogiri version and make the warning go away.

Posted to makandra dev (2012-09-27 16:05)