Ruby Simplified Part 1: Installing Ruby on Windows

Install the current version of Ruby (2.0.0-p247) using the Ruby Installer. During installing choose the options below, and finish the installation process.

image

Now if you go to the C:\Ruby folder, you’ll see,

image

Open up a command prompt, and type ruby –v,

image

We’ve successfully installed the current version! To get help with more Ruby commands use ruby –h.

Now let’s try out “Hello World” in Ruby. Type ‘irb’ at the command prompt to get the Interactive Ruby Shell – it’s a command line for Ruby. Then use puts to output a string.

image

To run a ruby file, create a file ‘hello.rb’,

image

Now execute the file with ruby hello.rb,

image

Advertisements

Ruby Simplified Series

Ruby has become a very popular programming language because of it’s simplicity and productivity. In this series we’ll explore some of the syntax and features of the Ruby programming language.

Ruby Simplified Part 1: Installing Ruby on Windows

Ruby Simplified Part 2: Major language features