Chapter 1. Interactive Ruby and the Ruby Environment

image with no caption

In Ruby, as in most programming languages, we’ll generally store programs in external files and execute them at once, as a unit. However, Ruby also gives you the option of typing the lines of a program one at a time and seeing the results as you go along, using Interactive Ruby (irb); irb is a shell, similar to bash in a Unix or Unix-like system or the command prompt in Windows. Using irb will give you a good idea of how Ruby processes information, and it should also help you gain an understanding of Ruby’s basics before you ever even write a program.

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.