How did I get here?

Posted by admin on Mar 11, 2010 in Rails, Ruby |

Sometimes it’s useful to know the stack trace at a certain point in your Ruby code without using the debugger (or throwing an exception). Here’s one way to do it:

puts Kernel.caller.join("\n")

Comments are closed.

Copyright © 2017 Standalone Code LLC All rights reserved. Theme by Laptop Geek.