Daniel Huckstep Daniel Huckstep - 1 year ago 85
Ruby Question

How do I drop to the IRB prompt from a running script?

Can I drop to an IRB prompt from a running Ruby script?

I want to run a script, but then have it give me an IRB prompt at a point in the program with the current state of the program, but not just by running rdebug and having a breakpoint.

Answer Source

you can use ruby-debug to get access to irb

require 'rubygems'
require 'ruby-debug'
x = 23
puts "welcome"
puts "end"

when program reaches debugger you will get access to irb.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download