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 Ruby Hash Creation

Whats Wrong

Can figure this out, im a dumb ****

grocery_item_1 = Hash.new
grocery_item_1 = {β€œname” => β€œmilk”}

1 Answer

28,558 Points

Your code is actually fine, the issue is of all things the quote marks you use. I don't know how you wrote the code but the quote marks you use are not standard ones, but stylized quote marks which are more commonly found within word documents and the like. Stylized quote looks similar to regular quotes but they are in reality entirely different symbols, and as such do not work to create strings in programming languages.

If you replace them with standard quote marks like this:

grocery_item_1 = Hash.new
grocery_item_1 = {"name" => "milk"}

Then your code will work.

Also as a side note I'd recommend editing your post, as swearing is frowned upon in this forum.

I didnt think my code was wrong, Thanks!