1

次のエラーが発生します。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 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>
4

1 に答える 1

1
  1. Ruby を Windows 7 64 ビットに正しくインストールする
  2. 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

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

于 2014-12-23T06:56:21.917 に答える