From: Brian Candler Date: 2003-06-01T07:07:33+09:00 Subject: Re: ncurses + redirect output On Sun, Jun 01, 2003 at 06:38:49AM +0900, Simon Strandgaard wrote: > STORY: ncurses output goes to $stdout. > if an error happens in the ruby code, then backtrace is written to > $stdout. > > PROBLEM: I cannot see this backtrace.. and I would really like to see what > went wrong, so it can be fixed. I think such things are normally written to stderr, so you should be able to do $stderr.reopen instead. Otherwise, you can always do: errfile = File.open("log","a") begin run_my_ruby_code rescue Exception errfile.puts "Error: #{$!}\nBacktrace: #{$!.backtrace}" end Regards, Brian.