Spelunking in Ruby
summary
Starts at humble puts then shows concrete techniques and tools: use Ruby's -D flag to print swallowed exceptions, read $! in ensure, set Thread.abort_on_exception = true for thread errors, use bundle open and gem pristine to edit and restore gems, and run the hometowngy to get a HomeTownTrace of object instantiation. For interactive work use pry with pry-nav and pry-stack-explorer to step and inspect frames. For deep problems use gdb to attach call rb_backtrace and redirect fds (risky can segfault), use strace to spot futex waits, and try RBTrace firehose (unstable on OS X).
AI-written summary · about
chapters (18)
- 0:00Spelunking in Ruby
- 1:33Debugging essentials
- 2:55Basic debugging with puts
- 5:24Stack traces with caller
- 6:47Debugging with -d flag
- 8:53Multi-threaded exception debugging
- 9:56Exploring gems with bundler
- 12:44Essential debugging gems
- 13:05Tracking object creation
- 14:54Interactive debugging with pry
- 16:40Stepping through code with pry-nav
- 18:04Debugging with pry-stack_explorer
- 20:33Debugging JRuby with VisualVM
- 22:37Rubinius debugging tools
- 24:47Debugging at C layer with GDB
- 33:19Tracing system calls with strace
- 35:48Tracing Ruby method calls
- 37:55Summary








