The problem is that other libraries are loading an earlier version of libxml. I found this by commenting out things in my Gemfile. In particular, in my case, RMagick loaded libxml 2.7.3. (It uses libxml to read SVG files.)
I tried rebuilding RMagick against libxml 2.7.7 as follows:
gem install --no-rdoc --no-ri rmagick -- --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib --with-xslt-include=/opt/local/libxslt --with-xslt-lib=/opt/local/lib
However, RMagick did not seem to care about these flags. It was again built using 2.7.3. (If anyone knows how to create RMagick for a specific version of libxml, please share your knowledge.)
Ultimately, I found a solution halfway. I decided that if I could not resolve the version conflict between the two gems, I would at least approve Nokogiri, which uses the newer version of libxml. To do this, I found out which gems in my Gemfile used Nokogiri and placed them first.
So, when I once had this:
gem 'rmagick', :require => 'RMagick' gem 'sanitize'
Now I have this:
gem 'sanitize'
Now the warning has disappeared, and RMagick has not yet complained. Disclaimer: I do not use SVG in my applications, so I have not confirmed that RMagick is fully compatible with libxml 2.7.7.
rlkw1024 Jan 28 '11 at 18:26 2011-01-28 18:26
source share