Ruby Ruby Basics Conditionals "if" Statements

MaryAnn Eleanya
MaryAnn Eleanya
8,626 Points

I am not sure why the program keeps saying that it is not able to find the method name.

Why is the program saying that I did not define the method properly

program.rb
    check_speed =30

if check_speed > 55
  print "too fast"
end

  if check_speed < 55
  print "too slow"
  end

      if check_speed == 55
  print "speed ok"
      end   

1 Answer

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

The check_speed that you've defined here is a variable, not a method. You'll need to define a method with the def keyword:

def check_speed
  # Your code here
end

You might want to review this video and some of the others in Stage 1 before continuing.