Hello World

suggest change
This example assumes Ruby is installed.

Place the following in a file named hello.rb:

puts 'Hello World'

From the command line, type the following command to execute the Ruby code from the source file:

$ ruby hello.rb

This should output:

Hello World

The output will be immediately displayed to the console. Ruby source files don’t need to be compiled before being executed. The Ruby interpreter compiles and executes the Ruby file at runtime.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents