在安装过程中无法让nokogiri遵守自定义路径参数

时间:2010-04-21 03:39:40

标签: ruby rubygems nokogiri

我正在尝试使用命令在dreamhost上本地安装nokogiri:

$ wget ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
$ wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
$ tar zxvf libxml2-2.7.6.tar.gz
$ cd libxml2-2.7.6
$ ./configure --prefix=$HOME/local/ --exec-prefix=$HOME/local
$ make && make install
$ cd ..
$ tar zxvf libxslt-1.1.26.tar.gz
$ cd libxslt-1.1.26
$ ./configure --prefix=$HOME/local/ --with-libxml-prefix=$HOME/local/
$ make && make install
$ export LD_LIBRARY_PATH=$HOME/local/lib
  $ gem install nokogiri -- --with-xslt-dir=$HOME/local \
      --with-xml2-include=$HOME/local/include/libxml2 \
      --with-xml2-lib=$HOME/local/lib 

但仍然会出错:

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 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... 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/ruby1.8
        --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


Gem files will remain installed in /home/myusername/.gems/gems/nokogiri-1.4.1 for inspection.
Results logged to /home/myusername/.gems/gems/nokogiri-1.4.1/ext/nokogiri/gem_make.out

它似乎没有查看我为库指定的路径。

我的安装方法有问题吗?

1 个答案:

答案 0 :(得分:0)

快速回答的最佳选择是使用IRC并访问freenode上的#nokogiri频道,或者访问Nokogiri的讨论列表:

http://groups.google.com/group/nokogiri-talk