title: Undefined method error in Ruby
body: <p>The following example was showed by my professor in class and it worked perfectly fine and printed </p>
  
  <pre><code>def printv(g)
    puts g.call("Fred")
    puts g.call("Amber")
  end
  
  printv(method(:hello))
  
  &gt;&gt;hello Fred
  
    hello Amber
  </code></pre>
  
  <p>but when I am trying to run it on my irb/RubyMine its showing undefined method error. I am trying the exact code what he showed in class. What am I missing?</p>
  
  <p>Thanks!</p>