CentOS gem install of libxml-ruby is failing

Discussion in 'Ruby' started by Xeno Campanoli, Mar 26, 2008.

  1. I'm trying to do a simple gem install so I can validate some XML files
    for a project, and the gem install fails as follows on my CentOS system:


    [root@miller ~]# uname -a
    Linux miller 2.6.18-53.1.4.el5 #1 SMP Fri Nov 30 00:45:16 EST 2007 i686
    athlon i386 GNU/Linux
    [root@miller ~]# gem install libxml-ruby
    Building native extensions. This could take a while...
    ERROR: Error installing libxml-ruby:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb install libxml-ruby
    checking for socket() in -lsocket... no
    checking for gethostbyname() in -lnsl... yes
    checking for atan() in -lm... no
    checking for atan() in -lm... yes
    checking for inflate() in -lz... yes
    checking for iconv_open() in -liconv... no
    checking for libiconv_open() in -liconv... no
    checking for libiconv_open() in -llibiconv... no
    checking for iconv_open() in -llibiconv... no
    checking for iconv_open() in -lc... yes
    checking for xmlParseDoc() in -lxml2... no
    checking for xmlParseDoc() in -llibxml2... no
    checking for /opt/lib() in -lxml2... no
    *** 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.

    Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
    --with-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-dir}/lib
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-socketlib
    --without-socketlib
    --with-nsllib
    --without-nsllib
    --with-mlib
    --without-mlib
    --with-mlib
    --without-mlib
    --with-zlib
    --without-zlib
    --with-iconvlib
    --without-iconvlib
    --with-iconvlib
    --without-iconvlib
    --with-libiconvlib
    --without-libiconvlib
    --with-libiconvlib
    --without-libiconvlib
    --with-clib
    --without-clib
    --with-xml2lib
    --without-xml2lib
    --with-libxml2lib
    --without-libxml2lib
    --with-xml2lib
    --without-xml2lib
    extconf failure: need libxml2.

    Install the library or try one of the following options to
    extconf.rb:

    --with-xml2-dir=/path/to/libxml2
    --with-xml2-lib=/path/to/libxml2/lib
    --with-xml2-include=/path/to/libxml2/include



    Gem files will remain installed in
    /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4 for inspection.
    Results logged to
    /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4/ext/libxml/gem_make.out
    ---snip---
    The only so I seem to have is:

    /usr/lib/libxml2.so.2.6.26

    Presumably there should be a symbolic link or something, but whatever is
    missing,...If I go ln -s /usr/lib/libxml2.so.2.6.26 /usr/lib/libxml2.so,
    then...
    Nope, it fails the same way...
    I also tried:

    Gem files will remain installed in
    /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4 for inspection.
    Results logged to
    /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4/ext/libxml/gem_make.out
    [root@miller ~]# gem install --with-xml2-dir=/usr/lib libxml-ruby
    ERROR: While executing gem ... (OptionParser::InvalidOption)
    invalid option: --with-xml2-dir=/usr/lib
    [root@miller ~]# gem install libxml-ruby --with-xml2-dir=/usr/lib
    ERROR: While executing gem ... (OptionParser::InvalidOption)
    invalid option: --with-xml2-dir=/usr/lib
    [root@miller ~]# gem --with-xml2-dir=/usr/libinstall libxml-ruby
    ERROR: Invalid option: --with-xml2-dir=/usr/libinstall. See 'gem --help'.
    [root@miller ~]# gem --with-xml2-dir=/usr/lib install libxml-ruby
    ERROR: Invalid option: --with-xml2-dir=/usr/lib. See 'gem --help'.
    [root@miller ~]#
    ----snip----
    xc
    Xeno Campanoli, Mar 26, 2008
    #1
    1. Advertising

  2. Xeno Campanoli wrote:
    > I'm trying to do a simple gem install so I can validate some XML files
    > for a project, and the gem install fails as follows on my CentOS system:


    Do you have the libxml development rpm installed?

    That's the first thing I'd check when these errors come up:

    > checking for xmlParseDoc() in -lxml2... no
    > checking for xmlParseDoc() in -llibxml2... no


    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
    Joel VanderWerf, Mar 26, 2008
    #2
    1. Advertising

  3. Joel VanderWerf wrote:
    > Xeno Campanoli wrote:
    >> I'm trying to do a simple gem install so I can validate some XML files
    >> for a project, and the gem install fails as follows on my CentOS system:

    >
    > Do you have the libxml development rpm installed?
    >
    > That's the first thing I'd check when these errors come up:
    >
    >> checking for xmlParseDoc() in -lxml2... no
    >> checking for xmlParseDoc() in -llibxml2... no

    >

    Thank you. That appears to have been what I needed. I installed
    libxml-devel and then retried the gem and it appears to have finished
    normally, with gem check showing no problems.

    xc
    Xeno Campanoli, Mar 26, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Gregory
    Replies:
    1
    Views:
    494
  2. c++student
    Replies:
    1
    Views:
    276
    Ross Bamford
    May 17, 2006
  3. Dan Stevens (IAmAI)

    Cannot install ruby gem 'libxml-ruby'

    Dan Stevens (IAmAI), Mar 1, 2007, in forum: Ruby
    Replies:
    0
    Views:
    164
    Dan Stevens (IAmAI)
    Mar 1, 2007
  4. Xeno Campanoli
    Replies:
    4
    Views:
    135
    Kyle Schmitt
    Apr 10, 2008
  5. Sebastian W.
    Replies:
    3
    Views:
    136
    Jens Wille
    Nov 25, 2008
Loading...

Share This Page