Watir gem installation

Subscribe to Watir gem installation 3 post(s), 2 voice(s)

 
Avatar karim.rayani 2 post(s)

I installed
http://rubyforge.org/frs/?group_id=167&release_…
http://rubyforge.org/frs/download.php/62213/rub…

and then installed rails which worked fine, then i went on to install watir, which is gem install watir or downloading the gem and firing the command gem install watir-1.6.1.gem

I get the below error

Hi,

I installed ruby 1.9.1 using the ruby installater at rubyforge
http://rubyforge.org/frs/?group_id=167&release_…
used one of the .exe there,

when i did a gem install watir

i get this error below of unable to create the make file, whats wrong here?

C:\Ruby19\bin>gem install watir-1.6.1.gem
Building native extensions. This could take a while…
ERROR: Error installing watir-1.6.1.gem:
ERROR: Failed to build gem native extension.

C:/Ruby19/bin/ruby.exe extconf.rb
checking for strncpy_s()… * 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:/Ruby19/bin/ruby
C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:362:in `try_do’: The complier failed to generat
e an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:415:in `try_link0’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:419:in `try_link’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:527:in `try_func’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:772:in `block in have_func’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:668:in `block in checking_for’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:274:in `block (2 levels) in postpo
ne’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:248:in `open’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:274:in `block in postpone’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:248:in `open’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:270:in `postpone’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:667:in `checking_for’
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:771:in `have_func’
from extconf.rb:9:in `’

Gem files will remain installed in C:/Ruby19/lib/ruby/gems/1.9.1/gems/win32-api-
1.4.5 for inspection.
Results logged to C:/Ruby19/lib/ruby/gems/1.9.1/gems/win32-api-1.4.5/ext/gem_mak
e.out

 
Avatar karim.rayani 2 post(s)

http://programming-gone-awry.blogspot.com/2009/…

this link did help me install ruby however the require statement is failing with the below error
C:\Ruby19\bin>irb
irb(main):001:0> require ‘watir’
C:/Ruby19/lib/ruby/gems/1.9.1/gems/user-choices-1.1.6/lib/user-choices/arglist-s
trategies.rb:152: warning: else without rescue is useless
SyntaxError: C:/Ruby19/lib/ruby/gems/1.9.1/gems/user-choices-1.1.6/lib/user-choi
ces/arglist-strategies.rb:148: syntax error, unexpected ‘:’, expecting keyword_t
hen or ‘,’ or ‘;’ or ‘\n’
when 0: # This is not considered an error because another source
^
C:/Ruby19/lib/ruby/gems/1.9.1/gems/user-choices-1.1.6/lib/user-choices/arglist-s
trategies.rb:178: syntax error, unexpected keyword_end, expecting $end
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/user-choices-1.1.6/lib/user-choi
ces.rb:1:in `require’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/user-choices-1.1.6/lib/user-choi
ces.rb:1:in `<top (required)>’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.2/lib/watir/opti
ons.rb:3:in `require’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.2/lib/watir/opti
ons.rb:3:in `<top (required)>’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.2/lib/watir/brow
ser.rb:2:in `require’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.2/lib/watir/brow
ser.rb:2:in `<top (required)>’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.2/lib/watir.rb:6
:in `require’
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.2/lib/watir.rb:6
:in `<top (required)>’
from (irb):1:in `require’
from (irb):1
from C:/Ruby19/bin/irb:12:in `’
irb(main):002:0>

 
Avatar bloritsch 2 post(s)

Ruby 1.9 enforced the original intent for case statements. The syntax is supported in 1.8, along with the variation that everyone seems to use (at least everyone with a C/C++/C#/Java background). The case statement should be written like this:

case(var) when 0 then
  1. do something
    end
    end

If you replace the colons after the value on the “when” lines with the word “then” the code should work. Submit a bug report to the watir folks to have them fix the case statements for the next version of the library. The “when X then” pattern works in 1.8, and is forward compatible so there shouldn’t be too much drama with it.

Signup or login to contribute