Question

Has anyone used Watir with IronRuby successfully? I am getting an error that the required file 'Watir' was not found. What path do I need to set to get this file to work in IronRuby?

For some reason my igem command is not working:

C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>igem instal l watir '"C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin\ir.exe"' is not recognized as an internal or external command, operable program or batch file.

I am using 0.9 version of Ironruby.

I remember that in 0.9 you have to indicate the ir tool: I used the following and got the error again!

C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>ir igem ins tall watir ERROR: While executing gem ... (RangeError) bignum too big to convert into Fixnum

The current version of RubyGems is 1.3.5:

C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>ir igem -v 1.3.5

I even tried using the full path:

require File.dirname(__FILE__) + "C:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir.rb"
Was it helpful?

Solution

Did you use gem install watir or igem install watir? If you are installing gems for IronRuby you have to use igem. Otherwise, it ends up being put inside the gems directory where your Ruby installation resides. IronRuby will not see that gems directory by default and you would have to use the full path to get to it. When using igem it puts the gem in the correct directory for use with IronRuby.

OTHER TIPS

Watir uses MRI Ruby's WIN32OLE library. Is this library supported with Iron Ruby?

I found that when you get the required watir not found message in regular ruby you need to put before require 'watir' the text require 'rubygems'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top