2013-03-10 80 views
9

我想用ruby启动命令提示符来使用jekyll和jekyll-s3。当使用gem install jekyll-s3时,我得到一个错误,告诉libxml2丢失,我应该访问http://nokogiri.org/tutorials/installing_nokogiri.html以获取安装依赖关系的帮助。当我访问该页面时,只是说我需要使用gem install nokogiri。但是,当我这样做时,我收到了类似的错误。安装nokogiri时出错

我发现一个相似的问题在这里问Error installing Nokogiri 1.5.0 with rails 3.1.0 and ubuntu,因为我使用Windows,我不能使用sudo命令。我还发现这个问题libxml2 missing when installing nokogiri's gem devkit (windows),并试图使用包含在问题中的命令,并且我得到了问题中包含的相同错误输出。那里的评论似乎没有帮助。

我已经包括在下面安装引入nokogiri错误的整个输出。我猜我需要安装某种先决条件包/库,但我不知道如何。我应该怎么做才能让这些宝石正常工作?

ruby 2.0.0p0 (2013-02-24) [x64-mingw32] 

C:\Users\Ryan Lang>gem install nokogiri 
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:/Ruby200-x64/bin/ruby.exe extconf.rb 
The system cannot find the path specified. 
checking for libxml/parser.h... no 
----- 
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokog 
iri.html for help with installing dependencies. 
----- 
*** 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:/Ruby200-x64/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}/ 
    --with-iconv-dir 
    --without-iconv-dir 
    --with-iconv-include 
    --without-iconv-include=${iconv-dir}/include 
    --with-iconv-lib 
    --without-iconv-lib=${iconv-dir}/ 
    --with-xml2-dir 
    --without-xml2-dir 
    --with-xml2-include 
    --without-xml2-include=${xml2-dir}/include 
    --with-xml2-lib 
    --without-xml2-lib=${xml2-dir}/ 
    --with-xslt-dir 
    --without-xslt-dir 
    --with-xslt-include 
    --without-xslt-include=${xslt-dir}/include 
    --with-xslt-lib 
    --without-xslt-lib=${xslt-dir}/ 
    --with-libxslt-config 
    --without-libxslt-config 
    --with-pkg-config 
    --without-pkg-config 
    --with-libxml-2.0-config 
    --without-libxml-2.0-config 
    --with-pkg-config 
    --without-pkg-config 
    --with-libiconv-config 
    --without-libiconv-config 
    --with-pkg-config 
    --without-pkg-config 


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokog 
iri-1.5.6 for inspection. 
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.6/ext/nok 
ogiri/gem_make.out 

C:\Users\Ryan Lang> 
+0

如果穆罕默德不会去山上,那么山肯定会来到穆罕默德.. http://stackoverflow.com/questions/5778804/installing-ruby-gems-manually/10386302#10386302祝你好运! – 2013-03-14 12:48:26

回答

9

我不认为在Windows上支持Ruby 2.0.0和x64的nokogiri还支持。我有类似的问题。

请访问:https://github.com/sparklemotion/nokogiri/issues/864,去底部“观看”线程更新。

+0

这仍然是真的吗? – n8gard 2013-07-30 14:55:54

+0

我正在使用32位Windows并获得相同的错误。你认为它可以在Windows x86上工作吗? – Chris 2013-08-01 02:38:16

+0

@Chris我认为他意味着ruby安装程序的32位版本。这确实确实有效。 http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct – 2014-02-03 21:00:32