2011-06-23 73 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的依賴。