Getting Started with Ruby Cucumber on Windows 10

Ruby can be a great language for testing. With libraries like Capybara for driving web apps and JSON, RestClient, SOAP, and others for interacting with service apps, you’ll find testing in Ruby requires much less code than in C# or Java.

Following instructions can be used to setup Ruby Cucumber on windows 10. Following instruction have been tested on windows 10. Should work on Windows 8.1.

Step1

As a first step download and install Ruby from http://rubyinstaller.org/ . Install the latest release of version 2.2.4 64 bit or 32 bit whichever applicable From <http://rubyinstaller.org/downloads/> . I will be using 32 bit version. The 64-bit versions of Ruby are relatively new on the Windows area and not all the packages have been updated to be compatible with it.

Installing Ruby cucumber on Windows 10

Make sure you check the option to “Add Ruby executables to your PATH.”

Step 2

Also install the Ruby Development Kit from the same place, which will allow Ruby to build native extensions for libraries.

Instructions are available here: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.

Note: while installing, check if you are installing the right version of DevKit.

C:\devkit> ruby dk.rb review
C:\devkit> ruby dk.rb init
C:\devkit> ruby dk.rb install

Step3: Install Ruby Cucumber Gems

To install Cucumber, first update current gem setup.

C:\Users\pintu>gem update --system:

Next, install the gems you need for cucumber web testing. Following are recommended

C:\Users\you> gem install --no-ri --no-rdoc rspec
C:\Users\you> gem install --no-ri --no-rdoc win32console
C:\Users\you> gem install --no-ri --no-rdoc watir-webdriver
C:\Users\you> gem install --no-ri --no-rdoc cucumber
Run Cucumber
C:\Users\you\Documents> cucumber

If you try to run Cucumber at this stage you will get an error of missing features. Refer the screenshot.

Ruby Cucumber on Windows 10 -2

C:\Users\you\Documents> cucumber --init
C:\Users\you\Documents> cucumber
You are now done.
Next -> Writing  your first test using ruby & cucumber on windows 10

Leave a Reply