2009-11-14 22 views

回答

3

錯誤可能會發送到錯誤流(stderr),而不是輸出流(stdout)。所以,你需要錯誤流重定向到輸出流:

script.rb > out.txt 2>&1 

或者,如果你只想錯誤:

script.rb 2> errors.txt