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

chrisroos avatarchrisroos created an issue

Despite what the title suggests, this is related to the pg gem. Honestly :-)

In summary, requiring pg before Nokogiri results in the warning above. I've created a gist containing the steps required to reproduce the warning: https://gist.github.com/2236861

I've looked through the source of the pg gem and can see no explicit reference to libxml: I'm assuming that including some of the postgres headers results in libxml being loaded. Is there anything I can do to ensure that libxml 2.7.8 is being loaded, rather than 2.7.3?

Comments (3)

  1. Michael Granger
    • changed status to open

    PostgreSQL built with SQL/XML support links against libxml, so there isn't anything I can do from pg to influence what version of it gets loaded. As you correctly observed, there isn't any XML-related code in pg.

    MacOS X 10.7 comes with libxml (2.7.3), and the linker loads libraries out of /usr/lib before /usr/local/lib, so I'm guessing you just need to tell the linker to look in /usr/local/lib first.

    Try running the same commands prefixed with the Homebrew libraries first in your library path, e.g.,

    DYLD_LIBRARY_PATH=/usr/local/lib bundle console
    

    The dyld(1) manpage has a bunch of other stuff you can use to diagnose dynamic library problems.

    Another option would be to configure PostgreSQL with the --without-libxml option if you don't need SQL/XML support.

    I'm a bit surprised that Homebrew installed libxml; I thought the whole point was that it doesn't install competing versions of system libraries.

  2. chrisroos

    Thanks very much for the response Michael, especially given that it's nothing to do with pg!

    Setting DYLD_LIBRARY_PATH did indeed get rid of the warning. I'm not very familiar with c compilation/linking/whatever but I'll be sure to read dyld's man page in an attempt to better understand what's going on in this case.

    Thanks again, Chris

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.