Friday, September 25, 2009

Watir Tutorial: Installation and Setup - Part I

Watir installation and setup - Part I



Installing watir is just two step process
  • Step #1 - Install Ruby

  • Step #2 - Install Watir



Step #1 - Installing Ruby


Download ruby binaries or installers.

Installing Ruby on Windows



You might have Ruby already installed. It is always good idea to check whether Ruby is already installed in your machine and the version of Ruby if it is available. Execite the following commond from your windows command prompt.


C:\Documents and Settings\Shrikant Wagh>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

If it is not installed you will get the following message


C:\Documents and Settings\Shrikant Wagh>ruby -v
'ruby' is not recognized as an internal or external command,
operable program or batch file.

Easiest way to install Ruby on Windows platforms is to use one-click installer. Click on this link to download the one-click installer
Ruby 1.8.6 One-Click Installer

Run the one-click installer and follow the instruction to install Ruby.

After installation is complete, verify your Ruby installtion using the same commant mentioed above.

If you want to explore other option to install Ruby, please visit http://ruby-lang.org/en/downloads.

Installing Ruby On Linux


For most of the Linux flavors, compiled packages/binaries are available to install Ruby.

Red Hat and Fedora Linux

Verify whether Ruby is already installed.


rpm -q ruby
package ruby is not installed

If it is not yet instyalled then you can install it using yum update manager. Any installtion tasks requires root access, so you can login with root access or use sudo


sudo yum install ruby

Follow the instructions prompted by installer to install required packages.

Verify your Ruby installtion once complete.


ruby -v
ruby 1.8.1 (2003-12-25) [i386-linux-gnu]

Debian or Ubuntu Linux


Verify whether Ruby is already installed.


ruby
The program 'ruby' is currently not installed.
You can install it by typing:
sudo apt-get install ruby
-bash: ruby: command not found

If it is not yet instyalled then you can install it using app-get. Any installtion tasks requires root access, so you can login with root access or use sudo


sudo apt-get install ruby

Follow the instructions prompted by installer to install required packages.

Verify your Ruby installtion once complete.


ruby -v
ruby 1.8.1 (2003-12-25) [i386-linux-gnu]

Installing Ruby On OS X


Your Mac might have Ruby already installed, verify which version on Ruby is installed on your Mac.

ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

You got the right version. Do nothing. If you got older versiona dn want to installt new version then you can use MacPorts or Fink


On MacPorts, you can install Ruby with…



% port install ruby

Also, you can doenload the source code and compile it locally.


For source code and more details of installting Ruby on OS X, refer to Ruby source code" for source, Ruby for Leopard for building Ruby on Mac OS X 10.5 (Leopard) and Ruby for Tiger for builing Ruby on Mac OS X 10.4 (Tiger)

1 comment: