How can I force Ruby to show a full stack trace? [duplicate]

I just got this error message:

...
from c:/ruby/lib/ruby/gems/1.8/gems/...
 ... 10 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/...
...

and the bug (of course) is hidden somewhere in ... 10 levels....

How can I force Ruby to show a full stack trace?


Solution 1:

begin
  # Code that raises exception
rescue StandardError => e
  puts e.backtrace
end