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

nothing is working on this one

I've tried this every way I can think of and still nothing works what am I doing wrong?

say.rb
def say(Ruby)
  puts "Ruby"
end

say ("Ruby")

You are not correctly passing the param but are very close to the correct answer. Here is how I did it.

def say(name)
  puts name
end

say("Ruby")

1 Answer

Amrit Pandey
Amrit Pandey
17,595 Points

In reality if you run this program in irl(ruby shell) it will work!

But, the process is wrong, you are hard coding "Ruby" string in the method.

What you wanna do is to create a method that prints whatever you pass in it. And the challenge says that you have to pass "Ruby"

so lets create a method

def say(something_to_say)
   puts something_to_say
end

now whatever you pass in place of something_to_say, method will print it.

let's pass "Ruby" in it

say("Ruby")

Now it will print Ruby! :)