Using the Ruby Interpreter and Environment

If you come from a Unix background, you’re probably already familiar with the concept of command-line options and environment variables. If you’re not familiar with these terms, they’re just ways for the computer to keep track of external data, usually configuration options. Ruby uses command-line options and environment variables to keep track of things like how paranoid or lax it should be in relation to security or how verbose to be about warnings. We’ve already seen an example of this in the instructions for installing Ruby from a source download, when we executed this command:

ruby --version

As you’d expect, that just asks Ruby to report its version. You can find out the various command-line options ...

Get Ruby by Example 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.