On May 22, 2009, at 00:35, Brian Candler wrote: > Robert Klemme wrote: >> Please do not let yourself be distracted by the warning. The crucial >> point is that after $defout has been reassigned the "2" does not >> appear >> any more on the screen => this is the object which is used by #puts. > > Just do what the warning says, and use $stdout instead of $defout: > > $ ruby -r stringio -e 'puts 1; $stdout=StringIO.new; puts 2' > 1 > $ > > However this doesn't help the OP who wanted to redirect STDERR. You > can > redirect $stderr, but lots of code writes to STDERR instead of > $stderr. Per the URL in my earlier message, this software is wrong and bugs should be filed.