Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Getting an odd Error on Ruby loop challenge
working on the following question
Using a loop construct, assign the value of the get_answer() method to an answer variable. Use the break keyword to exit the loop if the answer variable is equal to the string e. Assume get_answer() is already written
and I am getting the following error:
Bummer: Errno::ENOENT: No such file or directory @ rb_sysopen - 1
when entering in the following loop: loop do answer = gets.chomp.downcase break if answer == "e" end
# Assume get_answer() is already defined loop do answer = gets.chomp.downcase break if answer == "e" end
answer = gets.chomp.downcase is looking for input from the user. That's not what the challenge asks you to do. The instructions are to assign the value of the get_answer() method to an answer variable. That is why
answer = get_answer works.