gem install watir不工作

时间:2013-06-05 07:24:01

标签: ruby watir

C:\DevKit>gem install watir
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.

C:/Ruby192/bin/ruby.exe extconf.rb
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:/Ruby192/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:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-
1.6.0.rc1 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0.rc1/ext/nok
ogiri/gem_make.out

尝试安装watir.please帮助时出现此错误

5 个答案:

答案 0 :(得分:2)

出于某种原因,你的Ruby试图安装Nokogiri的预发布版本,这通常不会在没有明确尝试安装的情况下发生。我认为它可能与你在那里的Ruby版本有关。

但是,在安装Watir之前尝试安装一些旧版本的Nokogiri:

gem install nokogiri -v "1.5.9"
gem install watir

如果这不起作用,则将Ruby升级到1.9.3或2.0.0而不是1.9.2,然后再试一次。如果您要更改Ruby版本,请不要忘记再次安装DevKit!

答案 1 :(得分:2)

错误:执行gem时...(Errno :: EINVAL)参数无效 - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mini_magick-3.6.0/tes t / files / special! “chars'.gif - oecprashant

这可以通过执行来解决 gem install mini_magick -v 3.5

然后试试 gem install watir再次

答案 2 :(得分:0)

您需要从以下位置安装RubyInstaller Development Kit:

HERE

安装完成后,Watir会成功安装。


将它放在你的gemfile中并进行bundle install:

gem "watir", "~> 4.0.2"

这可以解决它。但我不是百分百肯定。

答案 3 :(得分:0)

watir需要nokogiri,正如错误所说,

libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokog
iri.html for help with installing dependencies.

你应该为nokogiri安装libxml2 您可以从ftp://xmlsoft.org/libxml2/

下载

nokogiri安装手册: Installing Nokogiri

答案 4 :(得分:0)

在Windows中,由于缺少XXXX,ruby开发环境可能会出现一些错误。 下载XXXX是一种姑息性的方法。 http://railsinstaller.org/ 这是我在windows中的ruby开发环境的解决方案。 它可能不是最好的选择。 但我认为railsinstaller会有所帮助。 最好的解决方案是迁移到linux或mac。

相关问题