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 Basics Ruby Syntax Method Arguments

Verity Onions
Verity Onions
541 Points

I am stuck on the method challenge. It says - undefined local variable or method `ruby' for main:Object please advise.

I have been trying to figure this out but not sure where I am going wrong. It either says my stack is too deep or the attached error code. I don't think I understand the question correctly.

I think the output the question is looking for on the console would just 'Ruby'. Have I misunderstood?

say.rb
def say(first)
  puts first
end

say(ruby)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi there,

You're on the right track, with one small error. The instructions ask you to **"pass the string "Ruby""**, but right now you are passing in a variable named Ruby, not a string. Remember, if you want to pass a string, you need to surround it with quotation marks.

Keep Coding! :) :dizzy:

Verity Onions
Verity Onions
541 Points

Thank you - I realised just before I got your message. So simple, but just couldn't see it at the time as I think I was looking for something more complicated!