Hello World from IRB

Download ruby eBook

Example

Alternatively, you can use the Interactive Ruby Shell (IRB) to immediately execute the Ruby statements you previously wrote in the Ruby file.

Start an IRB session by typing:

$ irb

Then enter the following command:

puts "Hello World"

This results in the following console output (including newline):

Hello World

If you don't want to start a new line, you can use print:

print "Hello World"

Stats

Contributors: 5
2016-10-20
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook