The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem installing mechanize gem

Discussion in 'General Discussion' started by dxm, Jun 12, 2009.

  1. dxm

    dxm Active Member

    Joined:
    Aug 1, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    I'm trying to install the ruby gem mechanize. It is failing on a dependency on libxslt (which is installed), which I can't resolve.

    Code:
    /scripts/gemwrapper install mechanize
    
    Building native extensions.  This could take a while...
    ERROR:  Error installing mechanize:
            ERROR: Failed to build gem native extension.
    
    /usr/bin/ruby extconf.rb
    checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
    checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
    checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
    checking for libexslt/exslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
    checking for xmlParseDoc() in -lxml2... yes
    checking for xsltParseStylesheetDoc() in -lxslt... no
    libxslt is missing.  try 'port install libxslt' or 'yum install libxslt-devel'
    *** 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-xslt-dir
            --without-xslt-dir
            --with-xslt-include
            --without-xslt-include=${xslt-dir}/include
            --with-xslt-lib
            --without-xslt-lib=${xslt-dir}/lib
            --with-xml2lib
            --without-xml2lib
            --with-xsltlib
            --without-xsltlib
    
    
    Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.1 for inspection.
    Results logged to /usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.1/ext/nokogiri/gem_make.out


    If I then try to install
    Code:
    yum install libxslt-devel
    it's already installed...

    Code:
    yum install libxslt-devel
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.sov.uk.goscomb.net
     * updates: mirror.bytemark.co.uk
     * addons: mirror.sov.uk.goscomb.net
     * extras: mirror.sov.uk.goscomb.net
    ci                                                                                                                               |  951 B     00:00
    base                                                                                                                             | 1.1 kB     00:00
    updates                                                                                                                          |  951 B     00:00
    addons                                                                                                                           |  951 B     00:00
    extras                                                                                                                           | 1.1 kB     00:00
    Excluding Packages in global exclude list
    Finished
    Setting up Install Process
    Parsing package install arguments
    Package libxslt-devel-1.1.17-2.el5_2.2.i386 already installed and latest version
    Nothing to do


    Platform is:
    cPanel 11.24.4-R36167 - WHM 11.24.2 - X 3.9
    CENTOS 5.3 i686 standard


    Anyone got any ideas on what I can try?
     
  2. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Have you tried WHM >> Main >> Software >> Module Installers >> Ruby Gem via WHM and search for it and install it there
     
  3. dxm

    dxm Active Member

    Joined:
    Aug 1, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    Just tried that and exactly the same output. I'm guessing it's some sort of issue with a build path or something. The dependencies are installed, but it's not finding them when it tries building the gem.
     
  4. oddsmojo

    oddsmojo Registered

    Joined:
    Dec 10, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hope this response finds you in time, here is how I resolved this exact issue. Not a fun one!

    Code:
    
    ~]# wget ftp://xmlsoft.org/libxml2/LATEST_LIBXML2
    ~]# tar -zxvf LATEST_LIBXML2
    ~]# cd libxml2-2.7.3/
    ~]# ./configure --prefix=/usr
    ~]# make && make install && make clean
    ~]# cd ..
    ~]# wget ftp://xmlsoft.org/libxml2/LATEST_LIBXSLT
    ~]# tar -zxvf LATEST_LIBXSLT
    ~]# cd libxslt-1.1.24/
    ~]# ./configure --prefix=/usr
    ~]# make && make install && make clean
    ~]# gem install mechanize
    Building native extensions.  This could take a while...
    Successfully installed nokogiri-1.3.3
    Successfully installed mechanize-0.9.3
    2 gems installed
    Installing ri documentation for nokogiri-1.3.3...
    Installing ri documentation for mechanize-0.9.3...
    Installing RDoc documentation for nokogiri-1.3.3...
    Installing RDoc documentation for mechanize-0.9.3...
    
     
  5. dxm

    dxm Active Member

    Joined:
    Aug 1, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    That worked perfectly. Thankyou so much!

    :)
     
  6. zinger

    zinger Registered

    Joined:
    Sep 28, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Same error

    Thanks for posting those commands oddsmojo. I was getting the same error when attempting to install the Spreedly gem. Once I did the manual / source libxml2 / libxslt package installs the gem installed fine.

    One general tip, when using sudo and && chained commands make sure to enter sudo for each command... I got hung up from not doing this and was about to post a question until I realized my error. "sudo make && make install && make clean" = errors

    For example:

    Code:
    ~]# sudo wget ftp://xmlsoft.org/libxml2/LATEST_LIBXML2
    ~]# sudo tar -zxvf LATEST_LIBXML2
    ~]# cd libxml2-2.7.3/
    ~]# sudo ./configure --prefix=/usr
    ~]# sudo make && sudo make install && sudo make clean
    ~]# cd ..
    ~]# sudo wget ftp://xmlsoft.org/libxml2/LATEST_LIBXSLT
    ~]# sudo tar -zxvf LATEST_LIBXSLT
    ~]# cd libxslt-1.1.24/
    ~]# sudo ./configure --prefix=/usr
    ~]# sudo make && sudo make install && sudo make clean
    
    Thanks!
     
Loading...

Share This Page