Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I step out of a loop with Ruby Pry?

People also ask

How do I get out of binding Pry?

Note: You must exit out of the current pry session by typing exit at the pry prompt and then re-run your file by entering ruby your_file_name. rb again in your terminal.

How do I run a Ruby script in debug mode?

In order to start the Ruby debugger, load the debug library using the command-line option -r debug. The debugger stops before the first line of executable code and asks for the input of user commands.


To exit Pry unconditionally, type

exit-program

Edit from @Nick's comment: Also works:

!!!

I use:

disable-pry

This will keep the program running, but will keep it from continuing to stop execution. This is especially helpful when you are debugging in the console.


To exit everything, use:

exit!

This should ignore all proceeding bindings.


Triple exclamation (!!!) would do that.