Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@taiansu taiansu commented Jul 30, 2012

#15 should be brew link libxslt ?

@douglasjarquin

This comment has been minimized.

Copy link

@douglasjarquin douglasjarquin commented Oct 10, 2012

@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

This comment has been minimized.

Copy link

@douglasjarquin douglasjarquin commented Oct 10, 2012

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

This comment has been minimized.

Copy link

@mdemare 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

This comment has been minimized.

Copy link

@thbar 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
@ghost

This comment has been minimized.

Copy link

@ghost ghost 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
You can’t perform that action at this time.