Starting an IRB session inside a Ruby script
suggest changeAs of Ruby 2.4.0, you can start an interactive IRB session inside any Ruby script using these lines:
require 'irb'
binding.irb
This starts an IRB session with the current self, local variables, and instance variables. Type Ctrl+D or quit to resume the program.
This can be very useful for debugging.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents