-
Close your blocks the minute you open them.
-
Check the line number.
-
Read the error the message. Like all of it. Seriously.
-
Adding a debug before and after.
-
Confirm all variable values.
-
Re-read the code that generated the error.
-
Read the entire test, description, describe, it block.
-
Reconfirm what the purpose of the unit of code that the error is in.
-
GO FOR A WALK
-
Confirm the type of objects.
-
Confirm the level of nested data structures.
-
Tell a story, out loud, about what you're trying to do.
-
Avoid the rabbit hole, don't yak shave, remember, constantly, exactly what you're trying to do.
-
One error at a time.
-
Run every change you're doing.
-
Copy the method to Pry and try to run it in isolation.
-
Confirm your return values.
-
Confirm the values of your arguments.
-
Ask someone.
Ruby Debugging Checklist by Flatiron School is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.