A Comprehensive Guide To Debugging Rails
Feedback systems for finding errors in your web application.
The most important tool a musician owns is not their instrument; it’s their mirror. Observable physical issues precede degradations in sound, and the saxophonist practicing “blind” may never notice that a misplacement of their thumb over a key caused the grating tone that has tormented them - and their neighbours - for months.
Code problem identification, which is the essence of debugging, benefits similarly from the use of observation, but its mirrors, peering instead into a software process, take the form of logs, debuggers, alerts, OS-level tools, and the instrumentation you design and insert into your codebase.
I’ve marked the sections I believe contain the information least often seen in other similar guides.
- Ruby / Rails Built-in Tools
- Pry Console
- Pry Debugger
- Operating System Level Mirrors [fresh info]
- Git Source Control Mirrors
- Online and Third Party Mirrors [fresh info]
- Logs, aka Historic Mirrors [fresh info in second half]
- Memcached Mirrors
- Custom Instrumentation [fresh info]
- Chrome DevTools Mirrors
I’d like to credit Ed Tee at GigSounder and Richard Conway for help with proof-reading and feedback, and to thank Hacker Retreat
Berlin for providing me with brilliant programming mentors and teachers.
Source control software gives us a unique insight into changes in code and the human intention behind them.
Why settle with the debugging tools built into Rails? Why not create your own custom tools to ease the load?
Chrome DevTools gives you yet another angle for debugging your software, especially the CSS and JS.