How to Write a Hello World Program in Ruby
Installation Ruby on Windows:; , Go to the Ruby official site and download latest version of Ruby software. ,Install the software on your system , After Installation we need to set environment variable. , Right click on my computer then go on...
Step-by-Step Guide
-
Step 1: Installation Ruby on Windows:;
Then write 'path' in variable name. write the path ruby->bin folder. i.e (C:\ruby\bin) under variable value.
Click OK. , The actual syntax of your hello world program will be:puts "Hello, world!"
In the above example, puts display the written content(inside double quote) in the browser.
In a simple way, puts is used to print a message.
At last you must be thinking that how easy this syntax is. ,, -
Step 2: Go to the Ruby official site and download latest version of Ruby software.
-
Step 3: Install the software on your system
-
Step 4: After Installation we need to set environment variable.
-
Step 5: Right click on my computer then go on properties->Advanced->Environment Variables.
-
Step 6: Click on new in user variables.
-
Step 7: While starting any programming language we have to know the hello world program of it.
-
Step 8: Ruby files are saved in .rb extension.
-
Step 9: Write the above Hello World programme using any text editor and save the file with extension of '.rb' i.e(hello.rb)
-
Step 10: Open DOS and go to the folder where the file is saved using the cd command.
Detailed Guide
Then write 'path' in variable name. write the path ruby->bin folder. i.e (C:\ruby\bin) under variable value.
Click OK. , The actual syntax of your hello world program will be:puts "Hello, world!"
In the above example, puts display the written content(inside double quote) in the browser.
In a simple way, puts is used to print a message.
At last you must be thinking that how easy this syntax is. ,,
About the Author
Jessica Watson
Creates helpful guides on creative arts to inspire and educate readers.
Rate This Guide
How helpful was this guide? Click to rate: