Topic: Ruby Programs
We have the choice of using any text editor as discussed in the editor section of this tutorial.
Ruby provides the flexibility on the basis of the operating systems that we can execute and run a ruby program by just giving the filename and this doesn’t need to mention any extension.
We may need to put .rb filename extension in few programs to get them executed successfully.
We need to pass the file for processing and execution to ruby interpreter twice. Once to go for the proper syntax errors and upon receiving the success status second time to execute it. We need to give –c and –w as command line switches to get the checking status for errors and warnings if required Here –c states the checking for syntax errors and –w demonstrates the warnings messages to be sent to programmer .If the execution is done successfully we get the actual result displayed on our computer screens.
How to get started and Open programs in Ruby
To write our first Ruby program we need to open either a terminal say Unix or can operate on command line in Windows. This can be done by selecting the "Run" option from start menu and then write cmd on it which stands for cmd. This will display the editor on which we can write the code of our first program.
We will get the information like this on our screen :
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Tim>_