如何从红宝石键盘输入?

时间:2011-08-23 07:16:19

标签: ruby input

如何从Ruby中获取键盘输入?

1 个答案:

答案 0 :(得分:6)

试试这个:

puts "In which city do you stay?"  
STDOUT.flush  
city = gets.chomp  
puts "The city is " + city