Tutorial by Examples

IRB means "Interactive Ruby Shell", letting us execute ruby expressions from the standart input. To start, type irb into your shell. You can write anything in Ruby, from simple expressions: $ irb 2.1.4 :001 > 2+2 => 4 to complex cases like methods: 2.1.4 :001> def method ...
As of Ruby 2.4.0, you can start an interactive IRB session inside any Ruby script using these lines: require 'irb' binding.irb This will start an IBR REPL where you will have the expected value for self and you will be able to access all local variables and instance variables that are in scope....

Page 1 of 1