title: Rails error while trying to load a Service in a controller
body: <p>My controller is defined as follows with a create method.</p>
  
  <pre><code>class AtestController &lt; BaseController
  def create
      result = create_something(params)
      @connection = Bunny.new
      @connection.start
      @channel = @connection.create_channel
      bunny = RabbitPublisherService::RabbitPublisher.new(@channel,@connection) 
      render :json =&gt; trigger, :status =&gt; :created
    end
  end
  </code></pre>
  
  <p>My Rabbit Publisher Service is defined as follows</p>
  
  <pre><code>module RabbitPublisherService
    class RabbitPublisher
  
      private
      attr_accessor :channel, :connection
  
      def initialize(channel, connection)
        puts "I reached here"
        @channel = channel
        @connection = connection
      end
  
      def publish(message)
        q    = @channel.queue("task_queue", :durable =&gt; true)
        q.publish(message, :persistent =&gt; true)
        puts "Message is Published..."
        sleep 1.0
        @connection.close
      end
    end
  end
  </code></pre>
  
  <p>When I try calling this service from the controllers create method, RabbitPublisherService::RabbitPublisher.new, I get an uninitialized constant error saying
  :error_message=>"uninitialized constant AtestController::RabbitPublisherService"</p>
  
  <p>Can someone please help me find out what I am doing wrong?</p>