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.