标签: ruby input
如何从Ruby中获取键盘输入?
答案 0 :(得分:6)
试试这个:
puts "In which city do you stay?" STDOUT.flush city = gets.chomp puts "The city is " + city