Difference between revisions of "Installing ruby with cucumber on a windows machine"
m (Gijsp moved page Install-windows to Installing ruby with cucumber on a windows machine without leaving a redirect) |
|
(No difference)
|
Revision as of 16:38, 13 June 2016
Contents
Complete Setup Guide for Ruby, Cucumber and Lapis Lazuli on Windows
Installing Ruby
- Download and open rubyinstaller-2.0.0-p598.exe*
- Accept the terms
- Install to C:\Ruby **
- Check all 3 checkboxes
* Ruby version 2 is used here because this is currently the most stable version in combination with
Windows 7 and the plugins we're using.
* We're installing Ruby 32 bit because 64 bit can cause issues.
** You can install to a different folder, but in the rest of this training we will refer to this
folder.
Installing DevKit
- Download and open DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
- Extract to C:\Ruby\devkit\
- Open command promt
- Go to Run (Windows Key + R)
- Write 'cmd'
- Press enter
- Go to C:\Ruby\devkit
- Write
ruby dk.rb init
* - Write
ruby dk.rb install
**
* You should see "found rubyinstaller"
** In the screenshot a warning a given because I already had it installed.
Installing the necessary plugins
Now the installation of Ruby is complete, we can start installing the necessary plugins. These are so called “Gems” in Ruby. (A ruby is a gem, so the creators decided to call their plugins gems)
- Open the command prompt and write the following commands:
gem update --system
gem install rspec --no-ri --no-rdoc
gem install win32console --no-ri --no-rdoc
gem install watir-webdriver --no-ri --no-rdoc
gem install cucumber --no-ri --no-rdoc
To make sure everything is up to date
Note: There is a chance that you'll get an SSL error, in that case refer to this answer
Installing rspec because it's a very common used gem
Win32console supports colored output when running scripts in command line
That's it! You're now ready to start setting up your cucumber project. You can read more about this in the next article.
Extra information
This section is for you to have a better understanding of what is happening during the installation. And what the commands we're using in console actually mean.
When we installed ruby, we checked a checkbox saying "Add ruby executables to your PATH". What we did here, was making ruby commands globally accessible in the console.
Now because these commands are global, we can go to devkit folder and write "ruby dk.rb install". Where we are actually saying: "Hey Ruby! I want you to look at this file dk.rb I have here and install it".
Same thing happens with "gem install watir-webdriver": "Hey Ruby, I want you to do something with a gem, which is installing and the name is watir-webdriver". After which Ruby is going to look online in their software system looking for a gem called watir-webdriver.