Simple Cucumber Installation in Windows 7

Problems:

  1. Installing cucumber in windows/pc is hard – mostly fails with so many errors 😦
  2. It works sometimes and sometimes not 😦
  3. Community and support is poor 😦
  4. Not easily explained anywhere 😦

So here YOU go:

Firstly:

  1. Visit Ruby Installer page and under left side Download Ruby 2.2.3(x32) or Ruby 2.2.3(x64). It depends on your PC wether it’s 32bit or 64 bit – download as accordingly.
  2. Install the downloaded rubyinstaller-2.2.3.exe file to c:/ drive (default location). And keep selecting (all), when options come to screen and move on next and complete the installation
  3. Now search for “Start command prompt with Ruby” and run this console.

Secondly: 

  1. Once again, Visit Ruby Installer page and under the “DEVELOPMENT KIT“, download DevKit-tdm-32…exe or DevKit-tdm-(x64)…exe. It depends on your PC wether it’s 32 bit or 64 bit – download as accordingly.
  2. Now unzip the DevKit-tdm-(x64)…exe file. And you will have a file named dk.rb.
  3. From “Start command prompt with Ruby”, locate the dk.rb or drag-drop this file to the console. 
  4. Once it will one on console, it will be like this
    c:\Users\users\ruby developmentkit\dk.rb init (hit enter)
  5. Again drag-drop the file to console, it will be like this
    c:\Users\users\ruby developmentkit\dk.rb  install (hit enter)

Thirdly:

Now we need to install few gem libary,

  1. gem install bundler #required 
  2. gem install cucumber

Forth:

  1. Download your cucumber projects and give this command “bundle install”.

Note:

  1. Ruby Installer and Development Kit preferred to install x64 or 32bit – depends on your PC. They have two version always there.
  2. To get color PASS/FAIL in windows console- Install Ansicon. Unzip the file, you will find x64/x32 – choose right one and ansicon (double click) or ansicon -i from console to install. It doesn’t work in 64bit at all. 
  3. Nokogiri is an HTML, XML, SAX, and Reader parser. It always messing up with windows setup. So, you need to setup manually.
    1. Download nokogiri desired version (mentioned in console or project requirement)
    2. Run this, gem install –local nokogiri-1.6.6.2-x86-mingw32.gem (just locate your file to console and hit enter)