Difference between revisions of "Installing ruby with cucumber on a windows machine"
Line 7: | Line 7: | ||
[[File:winstall-ruby.png|right|225px]] | [[File:winstall-ruby.png|right|225px]] | ||
# Download and the latest version of Ruby for windows '''32 bit''' on http://rubyinstaller.org/downloads/. | # Download and the latest version of Ruby for windows '''32 bit''' on http://rubyinstaller.org/downloads/. | ||
+ | #* We're installing Ruby 32 bit version because it's more reliable than the 64 bit version | ||
# Accept the terms | # Accept the terms | ||
− | # Install | + | # Install Ruby in the default directory (for example Ruby version 2.3.3 will be installed in C:\Ruby23) |
# Check all 3 checkboxes | # Check all 3 checkboxes | ||
− | |||
− | |||
− | |||
− | |||
<h2>Installing DevKit</h2> | <h2>Installing DevKit</h2> | ||
− | # Download and open the latest Devkit for Windows 32 bit on http://rubyinstaller.org/downloads/ | + | # Download and open the latest Devkit for Windows '''32''' bit on http://rubyinstaller.org/downloads/ |
− | # | + | # In your ruby directory create a new Folder with the name: ''devkit'' |
+ | # Extract the Devkit into the newly created folder | ||
#* [[File:winstall-devkit.png|225px]] | #* [[File:winstall-devkit.png|225px]] | ||
# Open command prompt | # Open command prompt | ||
## Go to Run (Windows Key + R) | ## Go to Run (Windows Key + R) | ||
− | ## Write | + | ## Write <code>CMD</code> |
## Press enter | ## Press enter | ||
#* [[File:winstall-runcmd.png|225px]] | #* [[File:winstall-runcmd.png|225px]] | ||
− | # | + | # In CMD go to your ruby directory (for example write the following <code>cd C:\Ruby\devkit</code>) |
# Write <code>ruby dk.rb init</code> | # Write <code>ruby dk.rb init</code> | ||
# Write <code>ruby dk.rb install</code> | # Write <code>ruby dk.rb install</code> | ||
#* [[File:winstall-devkit-console.png|225px]] | #* [[File:winstall-devkit-console.png|225px]] | ||
− | |||
− | |||
Revision as of 15:58, 13 March 2017
Contents
Installing Ruby
- Download and the latest version of Ruby for windows 32 bit on http://rubyinstaller.org/downloads/.
- We're installing Ruby 32 bit version because it's more reliable than the 64 bit version
- Accept the terms
- Install Ruby in the default directory (for example Ruby version 2.3.3 will be installed in C:\Ruby23)
- Check all 3 checkboxes
Installing DevKit
- Download and open the latest Devkit for Windows 32 bit on http://rubyinstaller.org/downloads/
- In your ruby directory create a new Folder with the name: devkit
- Extract the Devkit into the newly created folder
- Open command prompt
- Go to Run (Windows Key + R)
- Write
CMD
- Press enter
- In CMD go to your ruby directory (for example write the following
cd C:\Ruby\devkit
) - Write
ruby dk.rb init
- Write
ruby dk.rb install
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)
Copy the code written below and paste it in the CMD (right click, paste)
gem update --system gem install lapis_lazuli --no-ri --no-rdoc
While you're installing, do not copy any other text onto your clipboard or let your computer go to sleep. If you do so, CMD will stop installing after the last line of text.
More information about the installations above | |
---|---|
gem update --system
|
Will update all default gems installed with Ruby (can be outdated, even though you've just installed Ruby) |
gem install ffi --platform ruby gem uninstall ffi |
This gem is problematic with Windows, so it needs to be re-installed with the --platform ruby argurment.
|
gem install rspec --no-ri --no-rdoc
|
Commonly used gem |
gem install win32console --no-ri --no-rdoc
|
Will give coloured output. |
gem install selenium-webdriver --no-ri --no-rdoc
|
Gem that allows communication with browsers |
gem install watir-webdriver --no-ri --no-rdoc
|
Layer on top of Selenium that simplifies browser interaction |
gem install lapis_lazuli --no-ri --no-rdoc
|
Test automation gem that will enforce best practices, forcing the TA engineer to produce better code. |
gem install cucumber --no-ri --no-rdoc
|
The software that will run the scripts from console. |
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 installations
if you'd like you can now also install Ansicon so that test results will be colored in the commandline output
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 lapis_lazuli": "Hey Ruby, I want you to do something with a gem, which is installing and the name is lapis_lazuli". After which Ruby is going to look online in their software system looking for a gem called lapis_lazuli.