2017-11-03 libxml2 and Homebrew and Perl

I installed a new Perl and needed to install XML::LibXML.

cpanm XML::LibXML

But that didn’t work. I got an error and in the log file it would say:

running xml2-config...The installed version of libxml2 VERSION 2.9.4
 is not compatible with XML::LibXML (and probably buggy)!

At first I thought it was Homebrew.

brew upgrade libxml2

But the error remained. The key is to temporarily change the PATH:

export PATH="/usr/local/opt/libxml2/bin:$PATH"
cpanm XML::LibXML

This makes sure the correct version of xml2-config gets called.



Thanks for the tip - I have had long time issues with this. OpenSSL is a little bit different, so the OpenSSL approach did not really apply - thanks again

jonasbn 2017-12-13 18:21 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.