Star Development Corporation

Chapter 1: The Basics

Now, one can type in: ruby ./HelloWorld.rb (Omit the ./ if running on a Windows machine) and get the result:
=> Hello, world!

Next, add a line to indicate to the shell that you are running a Ruby program.
The #! at the beginning of the line is called a shebang. It works in both *nix and Windows.
The -w means that you are asking the Ruby interpreter to give you warnings of non-standard usage
before running your program.

#!/usr/bin/env ruby -w
puts 'Hello, world!'

This time, type in: ./HelloWorld.rb (Omit the ./ and, optionally, the .rb if running on a Windows machine):
=> Hello, world!