title: Accessing gem methods in rails app
body: <p>I created my own gem. It is a very basic gem with only a 'hi' method in it. In the lib directory of my gem I have 'mygem.rb' file which has the above method.</p>
  
  <p>Now I have created a simple rails app which is trying to use this method.
  So how should I use it?</p>
  
  <p>I tried to do something like this:-</p>
  
  <p>In my app/controllers I have a file named hello_controller.rb which looks like this... </p>
  
  <pre><code>class HelloController &lt; ApplicationController
  
      def index
          @message= mygem.hi 
          @count=3
          @bonus="This message came from the controller."
      end
  end
  </code></pre>
  
  <p>But on my localhost it is giving me the following error:
  NameError in HelloController#index</p>
  
  <p>uninitialized constant HelloController::mygem</p>
  
  <p>Please solve this error..</p>