2011-06-23 71 views
4

我一直在遇到很多这个宝石的问题,所以我读到我不得不使用de 1.5.0-beta。安装nokogiri的宝石devkit时缺少libxml2(windows)

由于我使用Windows,我下载了DevKit。但是,当我跑:

创业板安装引入nokogiri - 事先 - --with-XML2-LIB --with-XSLT的LIB

我得到:

Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
ERROR: Error installing nokogiri: 
     ERROR: Failed to build gem native extension. 

     C:/Ruby187/bin/ruby.exe extconf.rb --with-xml2-lib --with-xslt-lib --pla 
taform=ruby 
*** 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=C:/Ruby187/bin/ruby 
     --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-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=${xml2-dir}/lib 
C:/Ruby187/lib/ruby/1.8/mkmf.rb:1177:in `dir_config': private method `split' cal 
led for true:TrueClass (NoMethodError) 
     from extconf.rb:87 


Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/nokogiri-1. 
5.0.beta.4 for inspection. 
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/nokogiri-1.5.0.beta.4/ext/no 
kogiri/gem_make.out 

我能做些什么?

+0

'--plataform = ruby​​' typo? – Dogbert

+0

是的,已经编辑它 – tiiin4

回答

1

用如下命令

gem install nokogiri --pre -- --with-xml2-lib --with-xslt-lib 

它看起来像你想安装最新版本引入nokogiri的。尝试使用--version指定精确版本。

另请注意引入nokogiri 1.6+

  • 红宝石1.9.3或更高
  • 在引入nokogiri 1.6.0或更高版本,libxml2和是的libxslt不再要求

所以以下要求,如果你想使用红宝石1.8.7(这是EOL,btw),那么,是的,你需要指定nokogiri < 1.6。但是,如果你可以使用现代的,生动的红宝石,那么你可能会躲避lib的依赖。