Search This Blog

Thursday 16 June 2011

Step by Step - Cucumber, WatiR and Ruby installation tips

There are few road blocks you hit when you go about the process of installing Cucumber, Watir and Ruby the first time, you have to search all the information and then as you install there are some things that work while some dont , I just thought it may be a good idea to consolidate the information in one place for myself if i do run into this situation of having to install this again. I have tried and tested this thrice and use the same process to install our test agents.

  • Installing Ruby

#Tip – Choosing the version of Ruby installer

Watir is stable with Ruby 1.8.7 so dont carried away and install 1.9.x of ruby , you learn the hard way that it is not going to work properly.

See Http://watir.com/installation for updates on when 1.9.x support will be provided. Go to http://rubyforge.org/frs/download.php/74293/rubyinstaller-1.8.7-p334.exe download the exe and run the installer. I chose the installation folder to be called just ruby as I want to avoid installing multiple versions for now.

 

  • Ruby Path

Check if "c:\ruby\bin" is included in the path (else run PATH=%PATH%;c:\ruby\bin at the command prompt)

  • Installing the Dev Kit for Ruby

Download http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe .

  1. Click on it to extract files to a folder <DEV-KIT-FOLDER>.
  2. Open a command prompt for the <DEV-KIT-FOLDER>.
  3. Run the command “ruby dk.rb init
  4. Run the command “ruby dk.rb install

Not sure if you need this but run a “gem update system” and it should say Nothing to update :).

  • Installing gems

Now at the command prompt

  1. Run “gem install cucumber”.
  2. Run “gem install watir”
  3. Run “gem install “win32console”
  4. Run “gem install rspec”
  • Installing ANSI con – if you are unable to see colours on your console window when you run a cucumber feature, you may need to install ANSICON
  1. Go to http://adoxa.110mb.com/ansicon . Download AnsiCon 140.
  2. Extract the files.
  3. Open a command prompt for the folder you have extracted the files in
    cd to x64 folder if you use a 64 bit machine or x86 folder if you use a 32 bit machine
    type "ansicon.exe -i"
    Close the command prompt , open a new one

This should be sufficient to run cucumber features now. In a weeks time I will post a project framework with some useful stuff for ruby / selenium / cucumber which can be downloaded so you can go about building tests quickly

1 comment:

Gie said...

Hello,

First of thank you for your guide. I tried installing it following documentation on their websites but ran into a lot of problems, missing this and that. but following your guy i managed to install smoothly. the only problem now is...i can't seem to get the automated browser pop up when running the script. from my understand when you run a cucumber script a screen popup that allows you to see each step being executed. am i wrong? or is that like an extra plug in.

thanks