简体   繁体   English

在Windows上安装Nokogiri gem

[英]Installing Nokogiri gem on windows

I'm trying to install Ruby on my Windows environment. 我正在尝试在Windows环境中安装Ruby。 It works fine on my Ubuntu. 它在我的Ubuntu上运行良好。

I followed the instructions here: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit 我按照这里的说明进行操作: https : //github.com/oneclick/rubyinstaller/wiki/Development-Kit

Ruby 2.0 seems to be correctly set, both DevKit and RubyInstaller. DevKit和RubyInstaller似乎都正确设置了Ruby 2.0。

But when I try to bundle ig Get the following: 但是,当我尝试bundle ig时,获得以下信息:

gem install nokogiri -v '1.5.11'
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:/Ruby/RubyInstaller200-x64/bin/ruby.exe extconf.rb
Le chemin d'accès spécifié est introuvable.
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.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:/Ruby/RubyInstaller200-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}/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
        --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-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:/Ruby/RubyInstaller200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.11 for inspection.
Results logged to C:/Ruby/RubyInstaller200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.11/ext/nokogiri/gem_make.out

I already have this gem installed, but in another version. 我已经安装了这个gem,但是在另一个版本中。

C:\wamp\www\holdsport>gem list | grep noko              
nokogiri (1.6.2.1 x64-mingw32)

It seems like libxml2 isn't installed but I couldn't find out how install it on windows. 似乎没有安装libxml2,但是我找不到如何在Windows上安装它。 I don't know if the message extconf.rb failed is because the libxml2 is missing or another issue. 我不知道消息extconf.rb failed是因为缺少libxml2还是其他问题。

Any idea why it doesn't work? 知道为什么它不起作用吗?

Nokogiri doesn't support x64 ruby 2.0, for whatever reason. 出于任何原因,Nokogiri不支持x64 ruby​​ 2.0。 Try installing the x86 version of ruby instead. 请尝试安装x86版本的ruby。

If gem install nokogiri still doesn't work, install the pre-release with gem install nokogiri --pre . 如果gem install nokogiri 仍然不起作用,请使用gem install nokogiri --pre安装预发行版。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM