Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to run

bundle exec rake fixtures:populate_from_db

on CentOS but I get the following warning messages:

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

~/.bundle/config file contains:

BUNDLE_BUILD__NOKOGIRI: "--with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib --with-xslt-dir=/opt/local"

How should I compile Nokogiri again 2.8.0 version of LibXML?

like image 606
Hellboy Avatar asked Mar 17 '23 08:03

Hellboy


2 Answers

Try running:

gem update --system & gem pristine nokogiri

Just worked for me.

like image 50
Jonny Avatar answered Apr 26 '23 07:04

Jonny


The following steps solve my problem

gem uninstall nokogiri # remove nokogiri
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

Combine the solutions from https://simonharrer.wordpress.com/2013/05/01/fixing-nokogiri-warning-after-ubuntu-upgrade/ and https://github.com/sparklemotion/nokogiri/wiki/What-to-do-if-libxml2-is-being-a-jerk

like image 34
rocksoccer Avatar answered Apr 26 '23 08:04

rocksoccer