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
- Click on it to extract files to a folder <DEV-KIT-FOLDER>.
- Open a command prompt for the <DEV-KIT-FOLDER>.
- Run the command “ruby dk.rb init”
- 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
- Run “gem install cucumber”.
- Run “gem install watir”
- Run “gem install “win32console”
- 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
- Go to http://adoxa.110mb.com/ansicon . Download AnsiCon 140.
- Extract the files.
- 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