我一直无法让 Watir 在我的 Windows 7 x64 机器上工作。我正在使用以下内容:
http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-1.9.3-p448.exe https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559 -sfx.exe
我首先安装了上面列出的 ruby.exe,当安装到 c:\ruby193 时似乎运行良好。然后我将上面列出的开发工具包提取到 c:\devkit。然后我切换到 c:\rubydev 并运行ruby dk.rb init
并打开 config.yml 文件以确保它是正确的,它是。然后我跑了ruby dk.rb install
,这似乎很顺利,结果如下:
[INFO] Updating convenience notice gem override for 'C:/Ruby193'
[INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'
当我尝试安装 Watir 时,问题就来了。我输入gem install watir
并得到以下信息:
C:\Ruby193>gem install watir
Fetching: commonwatir-4.0.0.gem (100%)
Fetching: multi_json-1.7.9.gem (100%)
Fetching: rubyzip-0.9.9.gem (100%)
Fetching: ffi-1.9.0-x86-mingw32.gem (100%)
Fetching: childprocess-0.3.9.gem (100%)
Fetching: websocket-1.0.7.gem (100%)
Fetching: selenium-webdriver-2.35.0.gem (100%)
Fetching: watir-webdriver-0.6.4.gem (100%)
Fetching: win32-process-0.7.2.gem (100%)
Fetching: win32-api-1.4.9-x86-mingw32.gem (100%)
Fetching: windows-api-0.4.2.gem (100%)
Fetching: windows-pr-1.2.2.gem (100%)
Fetching: mini_portile-0.5.1.gem (100%)
Fetching: nokogiri-1.6.0.rc1.gem (100%)
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:/Ruby193/bin/ruby.exe extconf.rb
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:/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 C:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0.rc1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0.rc1/ext/nokogiri/gem_make.out
我不知道从这里做什么,我试图清理目录并再次执行该过程,但似乎无法克服这一点。
我的最终目标是安装 Watir,这样我就可以在 IE 中进行自动化测试。