Examining the Ruby Installation

Somewhere on your computer system, there's a Ruby installation. It contains the many files that Ruby needs to run. You can learn much from studying what's in this installation. For one thing, you can study Ruby's idea of program file organization close up.

In order to do this, you need to find the Ruby installation directory. (On a Unix or Linux system, this is typically /usr/local/lib/ruby.) You may have to hunt around a little. The actual files may be in a further subdirectory named for a Ruby version, such as /usr/local/lib/ruby/1.6. When you find a directory with upward of sixty files whose names end in .rb, along with subdirectories called irb and net, you're there.

Note

If you can't find your Ruby installation ...

Get Sams Teach Yourself Ruby in 21 Days 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.