Interactive Ruby

Interactive Ruby Shell (IRB or irb) is a REPL (Read Eval Print Loop) for programming in the object-oriented scripting language Ruby. As mentioned, we presume the abbreviation irb comes from the fact that the filename extension for Ruby is .rb.

The program is launched from a command line and allows the execution of Ruby statements giving an immediate response, letting us experiment interactively. It features command history, line editing capabilities, and job control, and is able to communicate directly as a shell script over the Internet and interact with a live server.

NOTE: irb was developed by Keiju Ishitsuka.

Try it yourself

In your terminal or shell, just type following

irb

Then, start playing with Ruby statements as

>> "Hello World"
>> 120
>> 15/2
>> 15.0/2

NOTE: This was just a intro of the IRB. We will play with it more in the later sections.