You can use STDIN from the I / O class rather than gets .
require 'io/console' def continue_story print "press any key" STDIN.getch print " \r"
This has an additional bonus, which requires only one character to be entered ( getch - get a character), allowing you to "press any key" to work without returning or entering.
source share