Search code examples
ruby-on-railssphinxthinking-sphinx

uninitialized constant ThinkingSphinx


I am running Rails 4.0.2 on Ruby 2.1.0, Sphinx 2.1.9 and thinking-sphinx 3.1.1
I've setup the search action in the home controller

def search
  @objects = ThinkingSphinx.search params[:search]
end

and I'm getting the

uninitialized constant HomeController::ThinkingSphinx

I have successfully indexed and started sphinx server.
I have also restarted my rails server a couple of times.
When I try to run the search from the console it works like a charm.
Am I doing something wrong or its some kind of bug?


Solution

  • Hmm it seems it works now! I've upgraded rails to 4.0.4 and i rebooted my vps, so the sphinx searchd daemon and my rails app were assigned with different pid. Looks like that solved it.