- Open a command prompt (Run and type cmd) and type
ruby -vto see if you have Ruby installed (if you don’t it will say the command isn’t recognized) and the version number.
- I have Windows 7 64 bit but I use the 32 bit installers from RubyInstaller Downloads including:
- Ruby 2.0.0-p247
- Run the Ruby installer and on the optional tasks page select the below items before completeing:
- Add Ruby executables to your PATH
- Associate .rb and .rbw files with this Ruby installation
- Open a new command prompt and type
ruby -vto see if Ruby installed and the version number.
- (Optional) Once installed you can update the RubyGems distributed with the installer by typing
gem update --systemand watching for the “RubyGems system software updated” to know when its complete.
- Move on to the DevKit installation.
- Run the DevKit installer but change the extraction folder to C:devkit
- Open a command prompt (Run and type cmd) and change the folder to C:devkit (use the command
- Run the command
ruby dk.rb init. If this step is successful you’ll see a response like “[INFO] found RubyInstaller v2.0.0 at C:/Ruby200”.
- Run the command
ruby dk.rb install. If this step is successful you’ll see a response like “[INFO] Installing ‘C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/defaults/operating_system.rb'” and “[INFO] Installing ‘C:/Ruby200/lib/ruby/site_ruby/devkit.rb'”
- Move on to Watir installation.
- Run the command (still from the C:devkit command window)
gem install mini_magick -v 3.5.0which works around the version problem. You should get a response like “2 gems installed”
- Then run the command
gem install watir --no-ri --no-rdocto install the rest of Watir. You should get a response like “Successfully installed watir-4.0.2-x86-mingw32 and 23 gems installed”.
browser = Watir::Browser.new
If all is setup correctly you should get your default browser to open a new window and then browse to Google. Good luck.
Note: These steps weren’t meant to replace the Homebrewer’s Guide to Watir by Zeljko Filipin instructions but to improve them for the 2.0.0 release. For everything else please refer to the guide.