print "Enter your password: " pass = STDIN.noecho(&:gets) puts "Your password is #{pass}!"
ВЫХОД:
Enter your password: input.rb:2:in `<main>': undefined method `noecho' for #<IO:<STDIN>> (NoMethodError)
Сначала
require 'io/console'
позже Ruby 1.9.3