FAQ: Thith Meanth War! - Getting User Input

This community-built FAQ covers the “Getting User Input” exercise from the lesson “Thith Meanth War!”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Ruby

FAQs on the exercise Getting User Input

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Hi everyone,

Been struggling a bit when it relates to gets.chomp function.

I’ve been trying many different things, even copy and paste the code from the solution but always get the same error message all the time.

Could anyone tell me what is wrong with the following code :

print "I need to go to the barber: "
user_input = gets.chomp

Thanks very much for your attention guys!

What error message are you getting?

Hi,

I was getting the one telling me my code was wrong! Even when copying the one from the solution.

Sometimes there is a problem getting using input.

Try manually entering a string and comment out the ‘gets.chomp’.

If you still get an error, post your code in a reply.

Just got it! Stupid mistake I made, wasn’t replying in the console :rofl:

1 Like

Hi everyone,

Could you tell me what’s wrong with this code?

print “There is something wrong with this thring!:”
user_input= gets.chomp

As julesbayon I’ve been trying many different things even copy and past the 1st exercise but the error message is always the same: Your code doesn’t look quite right. Check the first exercise if you need help!

Hi people! first of all forgive for my english, it is not so good.

When I run the code using the command gets.chomp what i am putting in the keyboard does not appear in the execution area. After sometime the message “execution expired” appear.

Thanks.

Hello,

I found that clicking on the blinking cursor, and then typing your input, works.
You may have to try this several times, though.

Thanks a lot dear friend.

1 Like