Basic Pry Consoling
Explore Pry console basics for troubleshooting and debugging within Rails. Learn to navigate object scopes, list methods, view source code, and handle exceptions to improve your Rails test development and debugging skills effectively.
Debugging examples
We’ve set Pry up as our Rails console, so we can access it with a simple rails console:
Try running the following commands in the rails console:
Examine object
Pry allows us to closely examine the current object under the scope, which we can determine with the self command. Right now, the current object is main:
Unix directory
Pry uses the Unix directory navigation metaphor to work through object trees. So, just as typing ls in a regular Unix terminal gives us a list ...