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 Defining Methods

def say_hi puts "hi" end

define a method error

def say_hi puts "hi" end

Bummer: Looks like you defined a "say_hi" method, but did you also call it?

Question is "But did you also call it?"

hello.rb
def say_hi
  puts "hi"
end

1 Answer

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi Fraser Henderson 👋

Your method is defined perfectly! But your code is not being ran until you're calling the method 🙂

def say_hi
  puts "hi"
end

say_hi

Adding the method call below your definition your code should pass the challenge tests as expected!

Hope this helps! 😃