Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libxml2 missing mac os x 10.10

Tags:

ruby

libxml2

Running 'compile' for libxslt 1.1.28... OK Running 'install' for libxslt 1.1.28... OK Activating libxslt 1.1.28 (from /Users/Kartik/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.4.1/ports/x86_64-apple-darwin14.0.0/libxslt/1.1.28)... checking for main() in -llzma... yes checking for xmlParseDoc() in libxml/parser.h... no checking for xmlParseDoc() in -lxml2... no checking for xmlParseDoc() in -llibxml2... no 

libxml2 is missing. Please locate mkmf.log to investigate how it is failing.

*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options. 
like image 968
John Smith Avatar asked Nov 12 '14 02:11

John Smith


People also ask

Where is libxml2 installed Mac?

OS X comes with libxml2 installed, but it's in /usr/include/libxml2 . So that needs to be added to the include path with a -I/usr/include/libxml2 . The headers contain the definitions of the various functions, but the real code lies in shared libraries.

How do I download libxml2?

Locate where you can get the latest version of the software. (From google, libxml2 webpage is here: http://www.xmlsoft.org/downloads.html. From there, you can find the ftp location where you can download the software.

Where do I put libxml2?

You can use an existing directory which is already in the path, such as C:\WINDOWS . You can also create a new directory for libxml and place the files there, but be sure to modify the PATH environment variable and add that new directory to its list.


1 Answers

i fiddled around with this for quite a while and the following worked for me..

1) install libxml2 with homebrew

brew install libxml2 

2) install the gem via

sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri:1.6.4.1 -- --use-system-libraries --with-xml=/usr/local/Cellar/libxml2/ 
like image 179
hlv Avatar answered Sep 23 '22 05:09

hlv