Search code examples
ruby-on-railsruby-on-rails-3sphinxthinking-sphinx

Rake task aborted, undefined method 'indexes' for Thinking Sphinx?


I have Sphinx and Thinking Sphinx 2.0.5 installed on my application and when I keep trying to run the command rake ts:index it gives me this error:

rake aborted!
undefined method `indexes' for #<Riddle::Configuration:0x41b57b0>

Is is talking about my Product model?

class Product < ActiveRecord::Base
  attr_accessible :name
  validates_presence_of :name

  define_index do
    indexes :name
  end
end

Why I am getting this and how do I fix it?


Solution

  • According to what is written here: https://github.com/freelancing-god/thinking-sphinx/issues/301

    In your Gemfile try changing:

    gem 'thinking-sphinx', '2.0.5'
    

    to

    gem 'thinking-sphinx', '2.0.10'