Problem with gets.chomp!


hi there,
I'm having a serious problem with gets.chomp. When ever I assign some code like

user_name = gets.chomp

my code doesn't work. I'm totally stuck at "thith meanth war!". Any solution?


When this line runs you will need to input something at the prompt in the console.


Thanks Roy for your kind reply.
There comes the problem. It does take any input. Seems like it freezes. I even tried different browsers to check if that was a problem from my browser. But no, same thing happened for all of the browsers. I guess there might be a technical problem.


As of July 12, 2017, Ruby is no longer offered. Start our new course Learn Ruby below

Please post a link to the exercise you are on. Thanks.


here is the link
thank you


Didn't freeze for me.

print "Your input would be appreciated!"
user_input = gets.chomp #.downcase!
if user_input.include? "s"
  user_input.gsub!(/s/, "th")
  puts "Your string: #{user_input}"
  puts "Yes, there are no 's's"


thanks a lot Roy. This time it ran correctly.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.