When I run this code in Sublime text, it enters an infinite loop instead of prompting user to 'Enter something'.
print 'Enter something'
input_user = gets.strip
if(input_user == 'something')
puts 'You are smart'
else
puts 'You are not'
end
- Can someone please help me understand why this is happening?
- Are there any other efficient ways to accept user input in ruby other than
gets
(without using third party libraries)?