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! While you're at it, check out some resources Treehouse students have shared here.

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

Ruby Ruby Collections Ruby Hashes Working with Hash Values

Problem with values_at exercice

Hi team, i have problem with this exerice, in the first step is done but when i got the second i have a error "Oops ! it looks like task 1 is no longer work".

can you help me please

grocery_item = { "item" => "Bread", "quantity" => 1, "brand" => "Treehouse Bread Company" }

if grocery_item.has_value? ("Bread")
   grocery_item["food"] = true


1 Answer

Jay McGavren
Jay McGavren
Treehouse Teacher

It looks like you're attempting to call a method named values_at ON a variable called grocery_list, which doesn't exist yet.

Whenever you see an "it looks like Task X is no longer passing" error, it will be accompanied by a button labelled "Go to Task X". You should click that button, and then try the same code on that earlier task. If you do that in this case, you'll see the error "NameError: undefined local variable or method 'grocery_list' for main:Object".

I would recommend going back to the videos and ensuring you're calling values_at in the correct way.