How to stop the Rails debugger for the current request

后端 未结 9 1363
既然无缘
既然无缘 2021-02-02 15:50

Say I have a loop in my code that calls the rails debugger a few times

def show
    animals = [\'dog\', \'cat\', \'owl\', \'tiger\']
    for animal in animals
           


        
相关标签:
9条回答
  • 2021-02-02 16:37

    You can always comment out the debugger call from your code then type reload in your debug session. Then just cont once and the request will continue without triggering a debug session.

    Because you're in development mode, you can just add the debugger call back in later and it will trigger correctly.

    0 讨论(0)
  • 2021-02-02 16:37

    If I want control back, I just do

    eval return
    

    and I will exit the currently running function, which will usually kick me back to the IRB [rails console] prompt.

    0 讨论(0)
  • 2021-02-02 16:44

    exit debugger out of the loop, use

    exit-all

    instead of

    cont

    Although, it will create an error and you might have to remove debugger and send request again but it will get you out of all the loops

    0 讨论(0)
提交回复
热议问题