thinking sphinx startup issue

when I do rake ts:start I get this error, mac:

private method `new' called for ThinkingSphinx::Configuration:Class

Ideas??

How do you have Thinking Sphinx installed? As a gem, or as a plugin? Either should be fine, but make sure you don't have both (and if you're not using the gem, make sure you don't have any versions of the gem installed, as Ruby may get a little confused). Also - make sure you don't have the old GitHub gem installed (freelancing-god-thinking- sphinx), as that can also cause conflicts.

The error is appearing because ThinkingSphinx::Configuration is a singleton class... but it's been that way for a long long time (if not forever), so I'm not sure what the cause of this is. Can you run the rake task with --trace?

  rake ts:start --trace

Also: what versions of Rails and Thinking Sphinx are you using?

Cheers

I have only the gem installed. Here is the trace:

** Invoke ts:start (first_time)

** Invoke thinking_sphinx:start (first_time)

** Invoke thinking_sphinx:app_env (first_time)

** Execute thinking_sphinx:app_env

** Invoke environment (first_time)

** Execute environment

** Execute thinking_sphinx:start

rake aborted!

private method `new’ called for ThinkingSphinx::Configuration:Class

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/ryanb-thinking-sphinx-0.9.8/lib/thinking_sphinx/tasks.rb:11

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:636:in `call’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:636:in `execute’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:631:in `each’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:631:in `execute’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain’

/Users/chabgood/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/monitor.rb:242:in `synchronize’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:604:in `each’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain’

/Users/chabgood/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/monitor.rb:242:in `synchronize’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:583:in `invoke’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2029:in `each’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2001:in `run’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:1998:in `run’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/bin/rake:31

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/bin/rake:19:in `load’

/Users/chabgood/.rvm/gems/ruby-1.8.7-p174/bin/rake:19

Rials 2.3.5 and sphinx 1.3.16

The stack trace says you're using Ryan Bates' fork of Thinking Sphinx - is that deliberate? Or perhaps that should be uninstalled, if it's conflicting?

  gem uninstall ryanb-thinking-sphinx

It's definitely an old release, well before 1.3.16.

Yes, I cannot it is in our production environment right now.

Never mind, overlooked that the ryanb was installed as a gem… DOH! sorry.

In your production environment for a different site? Or this one? I would highly recommend upgrading, either way... but in the meantime, you'll need to change your require statement for the thinking sphinx tasks in your Rakefile to have the full path. I'm not quite sure of the best way to do this to ensure it's flexible across environments, though...

Essentially, 'thinking_sphinx/tasks' exists in both ryanb-thinking- sphinx and thinking-sphinx - and I'm guessing Ruby searches through known paths in alphabetical order (R comes before T). You want to make sure your app loads from the right gem.

Cheers