When I debug rails code, I sometimes set a binding.pry
on a certain place that is triggered too often to be debugged, e.g. a loop.
Then I use the disable-pry
command to step out of it and let the rest of the program continue. But now when I make another request to the rails server, my breakpoints aren't triggered anymore. And this of course makes sense, as I called disable-pry
before.
The only known solution to me is to restart the whole server. But this becomes painful after a while, as reloading the whole environment can be pretty slow.
Is there a way to re-enable pry after having it disabled with disable-pry
without restarting the whole ruby process?
Use
ENV['DISABLE_PRY'] = nil
orENV.delete('DISABLE_PRY')
to reverse whatdisable-pry
does.As of version 0.13, this is what the method
disable-pry
looks like.