【问题标题】:Unable to install Watir gem on Windows 7 64-bit无法在 Windows 7 64 位上安装 Watir gem
【发布时间】:2013-10-12 09:28:45
【问题描述】:

我遇到了以下错误。当我尝试安装 gem watir 时,下面是 gem 列表,然后是 gem install watir。

我的系统配置是 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 时。我收到以下输出错误。

    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>

【问题讨论】:

  • 看来你应该先安装libxml
  • 你能告诉我怎么做吗
  • 也许这会有所帮助:xmlsoft.org/downloads.html
  • 我会试试的......
  • 你做了什么,发生了什么?有错误信息吗?

标签: ruby rubygems gem watir watir-webdriver


【解决方案1】:
  1. 在 Windows 7 64 位上正确安装 Ruby
  2. 成功安装 Ruby 后,从命令提示符处执行以下命令以安装 watir:

    gem 更新 --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

http://www.spritecloud.com/2011/04/complete-setup-guide-for-ruby-cucumber-and-watir-or-selenium-on-windows/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-28
    • 2018-10-07
    • 1970-01-01
    相关资源
    最近更新 更多