libxml-ruby: Failed to build gem native extension

后端 未结 7 1234
逝去的感伤
逝去的感伤 2021-02-07 19:24

I\'m trying to install libxml-ruby. I have installed libxml2, libxslt and coreutils

I have also read other posts rega

7条回答
  •  醉酒成梦
    2021-02-07 20:13

    The high level issue is shown here:

    checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... no
    

    Basically, the installer is telling you it can't find libxml/xmlversion.h but more generally it most likely can't find your libxml2 location. It tells you which four directories it's looking in so the first step is to check those directories to see if libxml2 is there.

    Assuming it's not in any of those four locations, you need to find it. Run find / -name xmlversion.h (might need sudo) to figure out where libxml2 got installed. Based on this answer I'm guessing your issue is that brew installed it to /usr/local/Cellar/libxml2 but you should confirm that. Once you have the location you can manually point your gem install command to it. Something like this: (but fill in path/to with your actual path)

    gem install libxml-ruby --with-xml2-dir=/path/to/libxml2 --with-xml2-lib=/path/to/libxml2/lib --with-xml2-include=/path/to/libxml2/include
    

提交回复
热议问题