101
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.
3) Run the following command.
This is final output of our Hello Ruby program.
Next TopicRuby operators