How do I get a stack trace using the ruby debugger?

spierepf picture spierepf · Apr 10, 2013 · Viewed 10.4k times · Source

I am trying to use the ruby debugger in a Rails app.

What command do I need to type at the (rdb:1) prompt in order to display a stack trace? I've tried backtrace, but it only lists the topmost frame.

Answer

konyak picture konyak · Jul 1, 2014

http://apidock.com/ruby/Kernel/caller

caller(0)  # Returns the stack trace, omitting 0 initial entry.