.jpg)
IRB is included with Ruby by default, so there's no need to install anything extra to use it. To start IRB, simply open a terminal and type "irb". This will launch the IRB prompt, which looks like this:
irb(main):001:0>
From here, you can type in Ruby code and see the results immediately. For example, you could type:
irb(main):001:0> 2 + 2 => 4
And you would see the output 4 immediately.
IRB also has some useful features that make it a great tool for exploring Ruby. For example:
- You can use the up and down arrow keys to scroll through previous commands.
- You can use the Tab key to autocomplete variable and method names.
- You can use the help command to see a list of available IRB commands and their descriptions.
0 Comments