Calling the Ruby Command
The most direct way to start the Ruby interpreter and run a Ruby program is by calling the ruby command from the command line. Regardless of the system in which Ruby is deployed, you have to start the Ruby interpreter somehow, and doing so gives us the opportunity to pass in command-line arguments both to Ruby itself and to the script being run.
A Ruby command-line call consists of three parts, none of which are required: options for the Ruby interpreter itself, the name of a program to run, and arguments for that program.
You only need the double-dash if you’re separating options to Ruby itself from options being passed to the program being run. The simplest Ruby command ...
Get Programming Ruby 3.3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.