Skip to content

Instantly share code, notes, and snippets.

@devpuppy
Created November 8, 2011 23:26
Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save devpuppy/1349681 to your computer and use it in GitHub Desktop.
Save devpuppy/1349681 to your computer and use it in GitHub Desktop.
How to fix: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
brew install libxml2 --with-xml2-config
brew link libxml2
brew install libxslt
brew unlink libxslt
gem install nokogiri -v 1.4.4 -- --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
sources:
https://gist.github.com/746966
https://gist.github.com/1226596
@taiansu
Copy link

taiansu commented Jul 30, 2012

#15 should be brew link libxslt ?

@douglasjarquin
Copy link

@talansu I think you may be correct. Following the instructions for the first time, when running #15 as is I got:

Unlinking /usr/local/Cellar/libxslt/1.1.26... 0 links removed

This tells us that it's a keg-only formula, so it doesn't automatically create the symlink for us.

Running the command as brew link libxslt, I got:

Linking /usr/local/Cellar/libxslt/1.1.26... 22 symlinks created

@douglasjarquin
Copy link

Started getting a similar error, but now about version 2.8.0:

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

Fixed with:

$ gem uninstall nokogiri
$ 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

@mdemare
Copy link

mdemare commented Feb 19, 2013

brew install libiconv gives an error, missing package.

It works without iconv however:

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28

@thbar
Copy link

thbar commented May 15, 2013

Thanks for this gist; here's what I did to use bundler, mixing this gist and my previous attempt:

bundle config build.nokogiri -- --with-xml2-dir=/usr --with-xslt-dir=/opt/local --with-iconv-dir=/opt/local

@dopa
Copy link

dopa commented May 24, 2013

This solution worked for me (on May 24, 2013):
https://coderwall.com/p/o5ewia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment