Difference between revisions of "Installing ruby with cucumber on a windows machine"

From Test Automation Wiki
Jump to: navigation, search
Line 2: Line 2:
 
<categorytree mode=all depth=1>Web_Test_Automation_Tutorial</categorytree>
 
<categorytree mode=all depth=1>Web_Test_Automation_Tutorial</categorytree>
 
</div>
 
</div>
 
  
  
Line 15: Line 14:
 
* You can install to a different folder, but in the rest of this tutorial we will refer to this folder.
 
* You can install to a different folder, but in the rest of this tutorial we will refer to this folder.
 
</blockquote>
 
</blockquote>
 +
  
 
<h2>Installing DevKit</h2>
 
<h2>Installing DevKit</h2>
Line 31: Line 31:
 
#Configure config.yml if needed.
 
#Configure config.yml if needed.
 
#* When you get the message "Invalid configuration or no Rubies listed. Please fix 'config.yml'". Please update your config.yml to point to the ruby folder. More info can be found [http://stackoverflow.com/questions/21184452/invalid-configuration-or-no-rubies-listed here].
 
#* When you get the message "Invalid configuration or no Rubies listed. Please fix 'config.yml'". Please update your config.yml to point to the ruby folder. More info can be found [http://stackoverflow.com/questions/21184452/invalid-configuration-or-no-rubies-listed here].
 
 
  
  
Line 47: Line 45:
 
'''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.'''
 
'''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.'''
 
</blockquote>
 
</blockquote>
 
  
 
{| class="wikitable collapsible collapsed"
 
{| class="wikitable collapsible collapsed"
Line 80: Line 77:
 
<p>That's it! You're now ready to start setting up your cucumber project. You can read more about this in the next
 
<p>That's it! You're now ready to start setting up your cucumber project. You can read more about this in the next
 
     article.</p>
 
     article.</p>
 +
  
 
<h2>Extra installations</h2>
 
<h2>Extra installations</h2>
 
<p> if you'd like you can now also install [[Install_ANSICON_for_coloured_output|Ansicon]] so that test results will be colored in the commandline output </p>
 
<p> if you'd like you can now also install [[Install_ANSICON_for_coloured_output|Ansicon]] so that test results will be colored in the commandline output </p>
 +
  
 
<h2>Extra information</h2>
 
<h2>Extra information</h2>

Revision as of 18:06, 10 March 2017


Installing Ruby

Winstall-ruby.png
  1. Download and the latest version of Ruby for windows 32 bit on http://rubyinstaller.org/downloads/.
  2. Accept the terms
  3. Install to C:\Ruby
  4. Check all 3 checkboxes
  • 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 tutorial we will refer to this folder.


Installing DevKit

  1. Download and open the latest Devkit for Windows 32 bit on http://rubyinstaller.org/downloads/
  2. Extract to C:\Ruby\devkit\
    • Winstall-devkit.png
  3. Open command prompt
    1. Go to Run (Windows Key + R)
    2. Write 'cmd'
    3. Press enter
    • Winstall-runcmd.png
  4. Go to C:\Ruby\devkit
  5. Write ruby dk.rb init
  6. Write ruby dk.rb install
    • Winstall-devkit-console.png
  7. Configure config.yml if needed.
    • When you get the message "Invalid configuration or no Rubies listed. Please fix 'config.yml'". Please update your config.yml to point to the ruby folder. More info can be found here.


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.

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 lazpis_lazuli". After which Ruby is going to look online in their software system looking for a gem called lapis_lazuli.