Rake任务中止,未定义的思考Sphinx方法'索引'?

Lea*_*RoR 8 sphinx ruby-on-rails thinking-sphinx ruby-on-rails-3

我在我的应用程序上安装了Sphinx和Thinking Sphinx 2.0.5,当我不断尝试运行命令时,rake ts:index它给了我这个错误:

rake aborted!
undefined method `indexes' for #<Riddle::Configuration:0x41b57b0>
Run Code Online (Sandbox Code Playgroud)

是在谈论我的Product模特吗?

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

  define_index do
    indexes :name
  end
end
Run Code Online (Sandbox Code Playgroud)

为什么我得到这个,我该如何解决?

Mic*_*pko 16

根据这里写的:https://github.com/freelancing-god/thinking-sphinx/issues/301

在您的Gemfile中尝试更改:

gem 'thinking-sphinx', '2.0.5'
Run Code Online (Sandbox Code Playgroud)

gem 'thinking-sphinx', '2.0.10'
Run Code Online (Sandbox Code Playgroud)