Building Watir

Why would you want build Watir?

  1. You want to use the latest version of Watir under development and don't want to wait for the next release.
  2. You have made changes to Watir and want to distribute your own version as a gem.

Getting the Watir source code

Watir's use Git as its source code management tool, leveraging the power of Github. There are many good tutorials for Git on the web. Here are a few for Git on Windows using both a GUI and the command prompt:

Once Git is installed, checkout the source:

  1. Create  or go to a directory to checkout into (e.g. "C:/dev"). Git will create a 'watir' directory there.
  2. Open a cmd prompt and navigate to that directory and execute
    git clone git://github.com/bret/watir.git
    

 You should now see a watir directory, containing 5 directories: .git, commonwatir, doc, firewatir, and watir

Installing Development Tools

You will need to install several gems used to build Watir.

gem install hoe
gem install rake
gem install ci_reporter

On Windows, you will need to define your "HOME" environment variable. Go to My Computer > Properties > Advanced > Environment Variables. Under Sytem Variables, look for a variable called HOME. If you don't have one yet, created one with a value something like "C:\Documents and Settings\Administrator" (Substituting whatever Windows login you use for 'Administrator' if needed).

Building the Gems

As of Watir 1.6, Watir now consists of 3 gems: watir, commonwatir and firewatir. Users on Windows will need to build all three. Users on other platforms only need to build commonwatir and firewatir.

Inside the watir directory are five directories, including one for each of the three gems (commonwatir, firewatir, and watir). To build each gem: In your watir directory, execute

rake gems

 This will create a watir/gems directory containing .gem files.

Installing the Gems

You should install them in the following order

  1. commonwatir
  2. firewatir
  3. watir

To install these gems, open the command shell into the watir/gems directory and execute

{{

gem install [gem-name]

}}

{{}}

See Development Builds for additional notes on installing local gems.

Listing the Gems

This command will list the gem versions on your local system, you should now have the latest development version listed. 

gem list --local

You can also do a gem uninstall on previous versions if you'd like.

gem uninstall watir

and you'll get a list of versions to choose from.

Updating your Source

To keep in sync with the latest code you can now

git pull

 ...from your watir directory (e.g. C:\dev\watir) and then follow the gem install process again.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.