Today we are going to look into the basics of ruby , how to get started , how to install and how to start writing your first Ruby program in under 10 seconds!
As previously mentioned in a previous post, Ruby was invented by Matz. It was designed & developed in the mid-1990s by Yukihiro “Matz” Matsumoto in Japan. Ruby is a dynamic, reflective, object-oriented, general-purpose programming language.
How to get started
A few years ago it was difficult to get started with Ruby because there was no or little documentation on installing Ruby on your computer . But in the last few years…Good News, with the explosion of people who want to learn Ruby , several tools have been created to install Ruby. These tools are called ‘Installers’.
So installers can be used to install a specific or multiple Ruby versions , don’t worry there are installers for windows as well! The most well know installer is called RubyInstaller. It gives you all the necessary files to setup a fully Ruby development environment on Windows. If you are on Mac then this is a clear guide from the guys at RailsApps
A ruby program can’t run on its own! You need to load a VM , which stands for ‘virtual machine’ So one of the main ways to execute this via the command line. If you’re on a Mac click on the terminal icon or if you’re on a PC go to the command prompt and type in irb
Write the first “Hello world”
At the command line type in “Hello World” – don’t forget the quotes and hit enter. You get the following
Ruby Obeyed you!
Now lets try some maths!
You also have a free calculator!
If you are having problems with installing Ruby , then no problems. You can try Ruby in your browser go to try ruby This gives you free 20 min lesson.
The great thing about ruby is that you really can’t go wrong , there is a strong community of people willing to help you get started. And if you are having problems there is plenty of documentation at the official ruby site to resolve your issues!
Ruby on Rails Coder & Marketer