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 (Retired) Ruby Methods Method Arguments

when I run this code in the console, it does not give me an answer.

Method arguments - I have the same code as shown in the video. When i type "ruby methods.rb", it does not give me the answer.

Luke Fritz
Luke Fritz
10,255 Points

Can you, please, edit your question to include the actual code here, so that we can see your code without having to review the video?

2 Answers

kabir k
kabir k
Courses Plus Student 18,036 Points

Since you are referring to the "Method Argument" video, I believe you can fix the issue with the following.

In the file, methods.rb,

1) define the method properly with the necessary keywords: def and end


call it

For example,

def add(a, b)
  puts a + b

add(2, 3)

2) make sure you save the file

3) then run the file again in the console

Hopefully, this helps.

I am getting the same problem. I have saved the file and still get a sintax error.