ruby - Undefined method for main:Object (NoMethodError) though method is defined -


i have defined script following code snippet:

check_params param  def check_params(param)  # code end 

when run get

undefined method `check_params' main:object (nomethoderror)

ruby expects method declared before call it, try move method definition before call method like:

def check_params(param)  # code end  check_params param 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -