我刚收到此错误消息:
...
from c:/ruby/lib/ruby/gems/1.8/gems/...
... 10 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/...
...
并且错误(当然)隐藏在... 10 levels...
中的某个地方。
如何强制ruby显示完整的堆栈跟踪?
答案 0 :(得分:74)
begin
# code that raises exception
rescue StandardError => e
puts e.backtrace
end