[Ruby] WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8

Tadashi Shigeoka ·  Sun, November 18, 2012

After installing the sunspot gem in Ruby on Rails and running rails g sunspot_rails:install, I encountered the common Nokogiri and LibXML error.

Error Details

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

Solution

As mentioned in the Stack Overflow question below, for Mac OS, install libxml2, libxslt, and libiconv via Homebrew, then set the path to these libraries and install Nokogiri.

compilation - WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.6.16 - Stack Overflow

For the installation method of libxml2, libxslt, libiconv, and Nokogiri, I referenced the following:

Nokogiri

That’s all from the Gemba.