runtime.getObject().storeConstant("STDERR", io);
runtime.getGlobalVariables().alias("$deferr", "$stderr");
}
private static RubyIO getRubyIO(Ruby runtime, Writer writer) throws IOException, BadDescriptorException {
PrintStream pstream = new PrintStream(new WriterOutputStream(writer), true);
RubyIO io = new RubyIO(runtime, pstream, false);
boolean locked = io.getOpenFile().lock();
try {
io.getOpenFile().setSync(true);
io.getOpenFile().io_fflush(runtime.getCurrentContext());