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...

10 Steps 1 min read Medium

Step-by-Step Guide

  1. 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. ,,
  2. Step 2: Go to the Ruby official site and download latest version of Ruby software.

  3. Step 3: Install the software on your system

  4. Step 4: After Installation we need to set environment variable.

  5. Step 5: Right click on my computer then go on properties->Advanced->Environment Variables.

  6. Step 6: Click on new in user variables.

  7. Step 7: While starting any programming language we have to know the hello world program of it.

  8. Step 8: Ruby files are saved in .rb extension.

  9. Step 9: Write the above Hello World programme using any text editor and save the file with extension of '.rb' i.e(hello.rb)

  10. 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

J

Jessica Watson

Creates helpful guides on creative arts to inspire and educate readers.

47 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: