Answers:
使用print代替。您可能要按继续STDOUT.flush。
STDOUT.flush将ios中的所有缓冲数据刷新到基础操作系统。$STDOUT.print "no newline" $STDOUT.flush产生no newline
另外,您需要在行末添加“ \ r”以表示“回车”,并在当前行的开头进行下一个打印
$stdout.sync = true
100.times do
print "."
sleep 1
end