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

Challenge 1 of 1

Now that you have a name variable, create another variable called >"favorite_food" with your favorite food. Bummer! We can't find variable "favorite_food" Here's my code

name = "My Name" puts "name" puts name

name = 'pizza' puts "favorite_food" puts name

Note. I also tried to code it

name = 'favorite_food' puts "pizza" puts name

and...

name = 'favorite_food' puts " #{name} is pizza!"

still wont pass. Tested code through workspace and all the codes outputs to console w/o any errors as I have coded >above, I also copied/pasted codes from workspace to challenge space with no luck.

Am I missing something?

4 Answers

Hello Fran,

At the moment in the above code you are including favorite_food in your name variable. So that is causing the error you need to create a new variable called favorite_food just like the example below.

favorite_book = "Example Book"

then to print out to the screen you can use

puts favorite_book

Hope this helps

I now see it, lol. Thank-you!

Wow I needed help with this as well! Great how the forums are such a resource

here is how you should put it

name = "My Name" favorite_food = "pizza" puts favorite_food

Derrick Lyons
Derrick Lyons
1,915 Points

This worked for me:

favorite_example = "Variable Name"