sparklemotion/nokogiri — pull request #923 by knu (2013-08-17 04:08:33+00:00)
Title: nokogiri 1.6.0 fails to load embedded version of libxml2 if absolute path changes

Our build system does a `bundle install --path ./bundler` on one machine; then tars up the result and sends it to the rest of production.

Unfortunately the tar-ball gets extracted into a different directory on the production servers from the temporary build server directory, which means that the absolute path hard-coded into `nokogiri.so` at compile time is wrong. This means that nokogiri picks up the system version of libxml2 and not the embedded version and you get a warning on start-up.

I think this is fixable on Linux by using Dylib.dlopen to open the libxml2.so file eagerly; not certain the correct way to fix on a Mac.

To replicate see the instructions at https://github.com/ConradIrwin/nokogiri-test.