title: Get current stack trace in Ruby without raising an exception
body: <p>I want to log the current backtrace (stacktrace) in a Rails 3 app <em>without</em> an exception occurring. Any idea how?</p>
  
  <p>Why do I want this? I'm trying to trace the calls that are made when Rails looks for a template so that I can choose a part of the process to override (because I want to change the view path for a particular subclassed controller of mine).</p>
  
  <p>I'd like to call it from the file: <code>gems\actionpack-3.2.3\lib\action_dispatch\middleware\templates\rescues\missing_template.erb</code>. I know that's not best practice, but I know it's downstream of the stack from where the search for templates occurs.</p>