Start by installing rvm. Dealing with ruby on a linux system without it is a nightmare.

RVM – Install

$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Install zlib

rvm pkg install zlib

You may also need to install zlib.

aptitude install zlib1g-dev

or

apt-get install zlib1g zlib1g-dev zlibc

Upgrade to the latest version of Ruby.

rvm install 1.9.2 --with-zlib-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr

Not doing the above resulted in:

    ERROR:  Loading command: update (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::UpdateCommand

Set Ruby 1.9.2 to be the default version

rvm --default use 1.9.2

Update the System so it has knowledge of all the gems etc.

rvm gem update --system

Install Selenium Web Drivergem install selenium-webdriver

Resources