End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO#flush
ios.flush → ios
io.c
View on GitHub ↗
VALUE
rb_io_flush(VALUE io)
{
return rb_io_flush_raw(io, 1);
}
Flushes any buffered data within ios to the underlying operating system (note that this is Ruby internal buffering only; the OS may buffer the data as well).
Example
$stdout.print "no newline" $stdout.flush
produces:
Example
no newline