# Installing libxml on osx as Gem

**URL:** <https://rubytalk.org/t/installing-libxml-on-osx-as-gem/31416>\
**Category:** ruby-talk\
**Created:** [28 September 2006 03:35 UTC](https://rubytalk.org/t/installing-libxml-on-osx-as-gem/31416 "2006-09-28T03:35:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicholas.henry](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nicholas.henry](https://rubytalk.org/u/nicholas.henry)\
**Post date:** [28 September 2006 03:35 UTC](https://rubytalk.org/t/installing-libxml-on-osx-as-gem/31416/1 "2006-09-28T03:35:07Z")

</div>

I'm trying to install libxml on osx as a gem (Ruby 1.8.2). Any ideas on  
how to resolve these issues? (please see output below)

Thank you,  
Nicholas

Attempting local installation of 'libxml'  
Local gem file not found: libxml\*.gem  
Attempting remote installation of 'libxml'  
Building native extensions. This could take a while...  
extconf.rb:64: undefined method `find\_header' for main:Object  
(NoMethodError)  
ERROR: While executing gem ... (RuntimeError)  
&nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.  
Gem files will remain installed in  
/usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8 for inspection.  
&nbsp;&nbsp;ruby extconf.rb install libxml\nchecking for socket() in -lsocket...  
no  
checking for gethostbyname() in -lnsl... no  
checking for atan() in -lm... no  
checking for atan() in -lm... yes  
checking for inflate() in -lz... yes  
checking for iconv\_open() in -liconv... yes  
checking for xmlParseDoc() in -lxml2... yes  
checking for libxml/xmlversion.h... no

---

<div class="post-metadata">

**Author:** ![Ross\_Bamford4](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@Ross\_Bamford4](https://rubytalk.org/u/Ross_Bamford4)\
**Post date:** [28 September 2006 11:40 UTC](https://rubytalk.org/t/installing-libxml-on-osx-as-gem/31416/2 "2006-09-28T11:40:25Z")

</div>

Hmm, find\_header should be defined by mkmf, so I don't understand what's  
going on there. Maybe it's something to do with OSX - has anyone else  
seen this?

Anyway, could you post up your ruby version? Also, the results of  
running this:

$ ruby -rmkmf -e 'find\_header("libxml/xmlversion.h", "/usr/include/libxml2")'

Thanks,

> **···**
>
> On Thu, 2006-09-28 at 12:35 +0900, nicholas.henry wrote:
> 
> > I'm trying to install libxml on osx as a gem (Ruby 1.8.2). Any ideas on  
> > how to resolve these issues? (please see output below)
> > 
> > Thank you,  
> > Nicholas
> > 
> > Attempting local installation of 'libxml'  
> > Local gem file not found: libxml\*.gem  
> > Attempting remote installation of 'libxml'  
> > Building native extensions. This could take a while...  
> > extconf.rb:64: undefined method `find\_header' for main:Object  
> > (NoMethodError)  
> > ERROR: While executing gem ... (RuntimeError)  
> > &nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.  
> > Gem files will remain installed in  
> > /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8 for inspection.  
> > &nbsp;&nbsp;ruby extconf.rb install libxml\nchecking for socket() in -lsocket...  
> > no  
> > checking for gethostbyname() in -lnsl... no  
> > checking for atan() in -lm... no  
> > checking for atan() in -lm... yes  
> > checking for inflate() in -lz... yes  
> > checking for iconv\_open() in -liconv... yes  
> > checking for xmlParseDoc() in -lxml2... yes  
> > checking for libxml/xmlversion.h... no
> 
> --  
> Ross Bamford - rosco@roscopeco.REMOVE.co.uk

---

<div class="post-metadata">

**Author:** ![nicholas.henry](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nicholas.henry](https://rubytalk.org/u/nicholas.henry)\
**Post date:** [12 October 2006 02:20 UTC](https://rubytalk.org/t/installing-libxml-on-osx-as-gem/31416/3 "2006-10-12T02:20:11Z")

</div>

Upgrading to 1.8.4 resolved this.

Ross Bamford wrote:

> **···**
>
> > On Thu, 2006-09-28 at 12:35 +0900, nicholas.henry wrote:  
> > \> I'm trying to install libxml on osx as a gem (Ruby 1.8.2). Any ideas on  
> > \> how to resolve these issues? (please see output below)  
> > \>  
> > \> Thank you,  
> > \> Nicholas  
> > \>  
> > \> Attempting local installation of 'libxml'  
> > \> Local gem file not found: libxml\*.gem  
> > \> Attempting remote installation of 'libxml'  
> > \> Building native extensions. This could take a while...  
> > \> extconf.rb:64: undefined method `find\_header' for main:Object  
> > \> (NoMethodError)  
> > \> ERROR: While executing gem ... (RuntimeError)  
> > \> ERROR: Failed to build gem native extension.  
> > \> Gem files will remain installed in  
> > \> /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8 for inspection.  
> > \> ruby extconf.rb install libxml\nchecking for socket() in -lsocket...  
> > \> no  
> > \> checking for gethostbyname() in -lnsl... no  
> > \> checking for atan() in -lm... no  
> > \> checking for atan() in -lm... yes  
> > \> checking for inflate() in -lz... yes  
> > \> checking for iconv\_open() in -liconv... yes  
> > \> checking for xmlParseDoc() in -lxml2... yes  
> > \> checking for libxml/xmlversion.h... no  
> > \>
> > 
> > Hmm, find\_header should be defined by mkmf, so I don't understand what's  
> > going on there. Maybe it's something to do with OSX - has anyone else  
> > seen this?
> > 
> > Anyway, could you post up your ruby version? Also, the results of  
> > running this:
> > 
> > $ ruby -rmkmf -e 'find\_header("libxml/xmlversion.h", "/usr/include/libxml2")'
> > 
> > Thanks,  
> > --  
> > Ross Bamford - rosco@roscopeco.REMOVE.co.uk
