I recently did a clean install of Mountain Lion, and after installing Nokogiri, I got an error when starting the Rails console: WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
So, I looked at other questions here on SO and deleted everything and tried again, but noticed that the installation instructions were out of date on the Nokogiri website: http://nokogiri.org/tutorials/installing_nokogiri.html
Because 'brew install libxml2 libxslt', it actually installs libxml2 2.8.0 and reads further the instructions that it refers to 2.7.8:
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
(notice libxml2 / 2.7.8)
So, I uninstall and reinstall again with: (libxml2 / 2.8.0)
sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.8.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.8.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
And while it seems to work fine in IRB, it doesn't work in Rails C - it still says:
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
I tried to start the package update, but it is still the same.
Any ideas how I can fix this, please?
source share