Problem with input value

I want to know how to get input value in Ruby??
don’t use GUI I use

print "Enter ID : "
id = gets.to_i

it can work in cmd but in many IDE it doesn’t work :’(
how can I do it??