0

私は約 1 年間、Watir または Watir-webdriver を使用していません。コンピューターのイメージに新しい 32x Windows 7 をインストールしました。次に、Ruby をインストール パック バージョン 2.0.0-p0 でインストールしました。次に、Ruby gem をバージョン 2.0.3 に更新しました。その後、DevKit-mingw64-32-4.7.2-20130224-1151-sfx という名前の devkit をインストールしました。これは、Web サイトが正しいものであると述べています。Devkit が正しくインストールされました。コマンド ラインを使用して Watir をインストールしよgem install watirうとすると、エラーが発生します。Watir がしばらくインストールされると、次のコード行が表示されます。コードが示すように、nokogiri.org サイトにアクセスしました。nokogiri のサイトでは geminstall nokogiriを使ってインストールするように言われていたので、インストールしました。次に、ffiをインストールしましたが、うまくいきました。他の誰かが同じ問題を抱えている場合に備えて、以下のコードを残します。

(....)
Fetching: mini_portile-0.5.0.gem (100%)
Successfully installed mini_portile-0.5.0
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:/Ruby200/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:/Ruby200/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:/Ruby200/lib/ruby/gems/2.0.0/gems/nokogiri-
1.6.0.rc1 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.0.rc1/ext/nok
ogiri/gem_make.out

これでwatirがインストールされました。いくつかのテスト スクリプトを実行して、機能しているかどうかを確認しました。だから今私はWatir-webdriverをインストールしたいと思っていました。コード 'gem install watir-webdriver を使用し、gem を適切にインストールしました。しかし、これは私が問題に遭遇したときです。ここから最新の chrome ドライバーをダウンロードして、パスにある ruby​​ bin に入れると、このエラーが発生します。

Microsoft Windows [バージョン 6.1.7601] Copyright (c) 2009 Microsoft Corporation. 全著作権所有。

C:\Users\kai.knutson>irb DL is deprecated, please use Fiddle
irb(main):001:0> require "watir-webdriver"
=> true 
irb(main):002:0> e = Watir::Browser.new :chrome Started ChromeDriver port=9515 version=0.8
log=C:\Users\kai.knutson\chromedriver.log
=> #<Watir::Browser:0x..fa558e0f6 url={"message"=>"no such session: url\n  (Driv er 
info: chromedriver=0.8,platform=Windows NT 6.1 SP1 x86)"} title={"message"=>" no such 
session: title\n  (Driver info: chromedriver=0.8,platform=Windows NT 6.1  SP1 x86)"}>

Internet Explorer を試してみるとうまくいきますが、適切にリンクをクリックできません。他にもいくつかの不具合があります。実行したコードが機能することはわかっています。なぜなら、watir クラシックまたは通常の watir を使用したときに完全に実行されたからです。だから私の質問はどうすればchromeを動作させることができるかということです.watir webdriverが動作しない原因となる何かがインストールに欠けています.

4

1 に答える 1