Rails アプリケーションにSearchkickを追加しようとしています。はじめにページの指示に従っていますが、次のエラーが表示され続けます。
Started GET "/airports" for 10.0.2.2 at 2014-05-26 10:20:33 +0000
Processing by AirportsController#index as HTML
Completed 500 Internal Server Error in 26ms
NameError (undefined local variable or method `searchkick' for #<Class:0xb48f3ba8>):
app/models/airport.rb:2:in `<class:Airport>'
app/models/airport.rb:1:in `<top (required)>'
app/controllers/airports_controller.rb:3:in `index'
Rendered /home/vagrant/.rvm/gems/ruby-2.1.1@global/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.5ms)
Rendered /home/vagrant/.rvm/gems/ruby-2.1.1@global/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.2ms)
Rendered /home/vagrant/.rvm/gems/ruby-2.1.1@global/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms)
Rendered /home/vagrant/.rvm/gems/ruby-2.1.1@global/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.8ms)
空港モデルは次のようになります。
# ./app/models/airport.rb
class Airport < ActiveRecord::Base
searchkick
end
これは、Airport コントローラーの外観です。
# ./app/controllers/airports_controller/rb
class AirportsController < ApplicationController
def index
@airports = Airport.all
end
end
何が原因ですか?