I\'m using Pry with my Rails application. I set binding.pry inside a loop in my model to try and debug a problem. For example:
(1..100).each do
Based on the two previous answers above:
Thank you guys! Your advices have helped me really a lot!
I just want to share a simple stupid trick, that I personally use to don't worry about the DISABLE_PRY environment variable all the time. Add this callback to the base controller ApplicationController of your project permanently. It would automatically re-enable PRY every time the disable-pry is called:
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_action :reenable_pry
private
def reenable_pry
ENV['DISABLE_PRY'] = nil
end
end