< Language Tutorials

Here are some instructions on how to make a program in the Ruby programming language that would say "Hello World!".

Prerequisites

A text or code editor is required to write Ruby code. There are many options available online.


Note Warning: Be careful when downloading programs from the internet; make sure to ask your parent or guardian first and download compressed files. If you just want to see how this works then use an online IDE.

Scratch Code

If you were making this with Scratch, you would code it like this:

when gf clicked
say [Hello World!]

Ruby Code

The Ruby code for this is shorter than the Scratch code shown above. The Ruby code is:

puts "Hello World!"

or

print "Hello World! \n"

print "Hello World!" can also be used, but a new line will not be added after printing "Hello World!".