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 Methods

Call a puts method

hello.rb def hello_rb puts "Hello World" end

I've tried the above syntax and got the message "incorrect" What am I doing wrong?

hello.rb
def hello_world
  puts "Hello World!"
end  

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! There's actually nothing really wrong with your syntax, rather a misinterpretation of the instructions. The puts method is a built-in method in Ruby. Here you've made your very own custom method which contains a puts method. But the challenge doesn't know to check for your own custom method, which is why it is failing.

You just went a little above and beyond the call of duty here. All it wants is the second line of your code, and it passes with flying colors! :sparkles: