0
votes

I have not used Watir or Watir-webdriver in about a year. I installed a fresh 32x Windows 7 on image on my computer. Next I installed Ruby with the installation pack version 2.0.0-p0. Then I updated ruby gem to version 2.0.3. After that I installed the devkit with the name DevKit-mingw64-32-4.7.2-20130224-1151-sfx, which is what the website said was the right one. The Devkit installed properly. Now when I went to install Watir using the command line, gem install watir, I get an error. Watir installs for a while and then I get these lines of code. I went to the nokogiri.org site as the code suggested. The nokogiri site said to install just use gem install nokogiri, so I did. I then installed ffi and it worked. I will leave the code below in case some one else has the same problem.

(....)
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

Now that watir was installed. I ran a few test scripts to see if it was working and it was. so now I wanted to install Watir-webdriver. I used the code 'gem install watir-webdriver and the gem installed properly. However this is when I run into problem. If i download the latest chrome driver from here and put it into the ruby bin, which is in my path, i get this error.

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

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)"}>

If I try and use internet explorer it works, but not properly I can't click on links, and there are a few other glitchy things. I know that the code that I ran works, because It ran perfectly when using watir classic or just normal watir. So my question is how can i get chrome to work, and am I missing something from the installation that would cause watir webdriver to not work.

1
is it generating a chromedriver.log file? that might hold some clues. I'd try to simulate what you are doing but I mostly use a mac these days, and the win7 vm I have is 64 bit, as is my home win7 system.Chuck van der Linden
As to issues such as not being able to click on a link, that might be best for a fresh SO question, with a link to the site in question and the code you are trying to use. (and of course any error messages you are getting)Chuck van der Linden

1 Answers

0
votes

Fresh install of Watir. I already had the devkit installed . I hit the 'libxml2 is missing' error on watir install. Did gem install nokogiri -then re-did the watir install- now all is well (watir installed). Environment: Platform Win 7 64 bit; ruby 1.9.3; rubyGems 1.8.24.
I got Ruby 1.9.3 at http://rubyinstaller.org/downloads. I just assumed it was 32 bit, which should run fine on Win7 64 bit OS Note I did NOT do gem update --system, since that updates RubyGems to 2.0.3. Check your Rubygems version, if you have RubyGems 2.0.3 then maybe that is the problem.