tags:

views:

33

answers:

1

JRuby script.rb throws many Java errors.

I tried outputting to a text file, but only the output from the script itself is recorded. I need to capture all the errors that happen, as they are very long. How can I do that?

+3  A: 

The errors probably go to the error stream (stderr), not the output stream (stdout). So you need to redirect the error stream into the output stream:

script.rb > out.txt 2>&1

Or, if you want just the errors:

script.rb 2> errors.txt
Thomas