Ruby is a programming language which were born in Japan and Japanese human language and adopted to English.
Rather than telling about history I'll move to practical stuff now.
Installing Ruby
If your using Windows OS download the setup from http://www.ruby-lang.org/en/downloads/ else if your using Linux OS install using "yum install ruby"
In Windows you may need to add the RUBY_PATH to classpath enviornment variable.
Once you have installed the rupy you can check it using following command by opening your terminal.
ruby -v
Hello World Program
Here we are going to run our first hello world program
Open your favorite text editor
Here is the butyl, you may remember your first Java/c#/etc Hello World program which having more than 4 lines. See the ruby hello world
Type following code:
puts "Hello World";
Save it as any name you wish(mine is first.rb) with .rb extension.
From your comman prompt/terminal cd to the file location execute using following command,
$> ruby first.rb
This print 'Hello World' on your terminal.
Thats it for the moment in future i'll come up with some more ruby programming.
No comments:
Post a Comment