Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

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

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

end
grocery_list.values_at(grocery_item)

1 Answer

Jay McGavren
STAFF
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.