Home » Hello Ruby Program

Hello Ruby Program

by Online Tutorials Library

Hello Ruby Program

Now we will write a simple program of Ruby. Before writing Hello World program, we are assuming that you have successfully installed Ruby in your system.


Requirement for Hello Ruby Program

  • Download Ruby and install it.
  • Create a file with .rb extension.
  • Connect Ruby path to the file.
  • Run the file.

Creating Hello Ruby Program

1) Use any text editor and create a hello.rb file. Write the following code,

2) Connect Ruby path to the above file. We have created hello.rb file in the Desktop. So first we need to go the Desktop directory through our console.

Ruby Hello ruby program 1

3) Run the following command.

Ruby Hello ruby program 2

This is final output of our Hello Ruby program.


Next TopicRuby operators

You may also like