我遇到以下错误。当我尝试安装gem watir时,下面是gem install watir后面的gem列表。
我的系统配置是OS-Windows7(64位),浏览器是IE = 9
C:\Users\Farooq>gem list
*** LOCAL GEMS ***
bigdecimal (1.2.1, 1.1.0)
childprocess (0.3.9)
commonwatir (4.0.0)
ffi (1.9.0 x86-mingw32)
io-console (0.4.2, 0.3)
json (1.8.0, 1.5.5)
mini_portile (0.5.1)
minitest (5.0.8, 2.5.1)
multi_json (1.8.1)
rake (10.1.0, 0.9.2.2)
rdoc (4.0.1, 3.9.5)
rubyzip (1.0.0, 0.9.9)
selenium-webdriver (2.35.1)
watir-webdriver (0.6.4)
websocket (1.1.1, 1.0.7)
win32-api (1.5.0 universal-mingw32)
win32-process (0.7.3)
windows-api (0.4.2)
windows-pr (1.2.2)enter code here'
enter code here
当我执行gem install watir时。我收到以下输出错误。
C:\Users\Farooq>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.
D:/Ruby193/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=D:/Ruby193/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 D:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri-
1.6.0.rc1 for inspection.
Results logged to D:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0.rc1/ext/nok
ogiri/gem_make.out
C:\Users\Farooq>
答案 0 :(得分:1)
成功安装Ruby后,从命令提示符执行以下命令以安装watir:
gem update --system --no-rdoc --no-ri
gem install watir --no-rdoc --no-ri
您可以点击链接了解详情:
http://www.mytechfetish.com/2013/08/installing-ruby-and-watir-on-windows-7.html