For up to date installation instructions download Homebrewer’s Guide to Watir book. You can download the book for free. If you buy the book the money goes to Watir project.


Visit the following links for having trouble with installation:

Installing Behind an Authenticating Proxy

Watir drivers are packaged as gems, Ruby libraries that can be installed over the internet. If installing behind an authenticating proxy, first set the HTTP_PROXY environment variable:




export http_proxy=


Install Ruby on Linux

Use your relevant package manager to update or install Ruby with the following at a terminal window:

sudo apt-get install ruby  # for Ubuntu / Debian users
sudo yum install ruby      # for Red Hat / Fedora users

Update RubyGems on Linux

Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:

sudo apt-get install rubygems # for Ubuntu / Debian users
sudo yum install rubygems  # for Red Hat / Fedora users

Install a HTML Inspector

To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.

Installing or Updating RubyGems

While updating RubyGems, or installing any of the gems, you can use the following additional flags:

--no-rdoc --no-ri

For example:

gem update --system --no-rdoc --no-ri
gem install watir --no-rdoc --no-ri

It will be much faster, but you will not install RDoc and ri.

28 thoughts on “Installation

  1. Very good instructions. The Ubuntu setup went well. There’s this great article about setting up opera using apt-get which was helpful.

    Do all this as root:
    wget -O – | apt-key add –
    echo deb stable non-free > /etc/apt/sources.list.d/opera.list
    apt-get update
    apt-get install opera

  2. Pingback: Migrating Unit Tests from Selenium to Watir Webdriver

  3. later versions of Xcode – 4.4 at least, possibly 4.0, require that you install the Xcode command line tools before you can install safariwatir, or anything else for that matter.

    Watir-webdriver, apparently is more likely to be up to date than safariwatir.

  4. I don’t think it’s such a good idea to install ruby using apt-get or yum. If you do, you’re stuck with the latest version that the repository has, which is never current. You surrender finer control and benefits of the latest ruby environment. I would follow the install steps for rbenv or RVM (don’t do both!!!).

    • Installing ruby on Linux via apt-get or yum is the simplest way. If somebody just wants to try Ruby or Watir, there is no need to install RVM. If later on they decide they need a Ruby version that is not supported by their package manager, they can install RVM then.

  5. Personally I think it would be better to give download/install instructions OUTSIDE of the book that costs $$ unless you want to feel like an absolute wretch for downloading a book that obviously took effort, lots of time, thought and hard work; just to be able to install software that you’ve no clue if you really want to buy and wanted to try but not for $9.99, especially since it might be your $9.99 as trying to justify buying a book to just try software probably wouldn’t be met with a re-reimbursement….

    If you offered how to download outside, you might get more people buying the book instead of looking at it, going back to the download page and re-reading, then going and looking at the price and deciding the guilt factor wasn’t worth it when there are lots of automation tools out there…

  6. Trying to set this up on Mint 15 became a wee bit of an annoyance. The missing piece came from a reference I found via Google to someone installing Ruby with the command `sudo apt-get install ruby-full`. Prior to that, I had done `sudo apt-get install ruby` as directed above, and when time came for `gem install watir-webdriver`, I got a rather cryptic error message.

    If you’re trying to install on Ubuntu, Mint, or a similar Debian based system, and you get to the point where `gem install watir-webdriver` is failing, run `sudo apt-get install ruby-full` then retry `gem install watir-webdriver`. I bet you’ll have better luck.

    Happy testing!

  7. Is this still an active site? I’ve not found a comment more recent than 23 October 2013. It doesn’t mean they aren’t there, just means I’ve not found them.

  8. Can we not have a downloadable package for Watir? My organisation doesn’t allow automatic downloads for software packages. Scansafe terminates the requests I think. If there were downloadable package I could ask people to download it and install.

    • Watir is an all-volunteer project that is always looking for help. If you would like to create a downloadable package to share with others, let us know.

  9. Any advice ? installing Ruby per your instructions . Getting an error with chromedriver -using the latest one …
    irb(main):001:0> require “selenium-webdriver”
    => true
    irb(main):002:0> browser = Selenium::WebDriver.for :chrome
    Net::ReadTimeout: Net::ReadTimeout
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/protocol.rb:158:in `rescue in rbuf
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/protocol.rb:152:in `rbuf_fill’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/protocol.rb:134:in `readuntil’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/protocol.rb:144:in `readline’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http/response.rb:39:in `read_statu
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http/response.rb:28:in `read_new’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1414:in `block in transpor
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1411:in `catch’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1411:in `transport_request

    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1384:in `request’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1377:in `block in request’

    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:853:in `start’
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1375:in `request’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/remote/http/default.rb:107:in `response_for’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/remote/http/default.rb:58:in `request’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/remote/http/common.rb:59:in `call’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/remote/bridge.rb:657:in `raw_execute’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/remote/bridge.rb:122:in `create_session’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/remote/bridge.rb:87:in `initialize’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/chrome/bridge.rb:48:in `initialize’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/common/driver.rb:56:in `new’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver/common/driver.rb:56:in `for’
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.46.2/li
    b/selenium/webdriver.rb:84:in `for’
    from (irb):2
    from C:/Ruby21-x64/bin/irb:11:in `’irb(main):003:0> browser.get “h
    NoMethodError: undefined method `get’ for nil:NilClass
    from (irb):3
    from C:/Ruby21-x64/bin/irb:11:in `’

    • You are unlikely to get much help through comments. Please consider using one of the support options such as the mailing list or Stack Overflow.

      However, as the problem is specific to Selenium-WebDriver, you might have more luck going to their mailing lists.

  10. Hai dude am using ubuntu 12.04 and am trying to install watir in my lap but it return ERROR ruby zip requires ruby 1.9.2 but i alreadu installed that what is the reason it ll return that plz answer any one

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s