In deference to a tradition started with the classic book that taught so many people how to program in C, The C Programming Language by Brian Kernighan and Dennis Ritchie, let's crank out the obligatory “Hello, world!” program. Try typing this directly into a terminal window:
% ruby -e 'puts "Hello World!"' Hello World!
Was that really a program? Well, yes. A program that does something simple, such as print a message, needs no elaborate structure. In fact, the program proper lives within the single quotes, and is this:
puts "Hello World!"
As you might guess, puts means to put a string of characters someplace, in this case the screen.
The code that surrounds the program is our way of starting the Ruby ...