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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World