I have a model with a searchable
block, like so:
class Contact < ActiveRecord::Base
searchable do
text :contact_name, :company_name, :contact_email
end
end
In the controller's index
action, I'm calling Contact.new
, which is giving me an error message on the page, which is currently running on our Staging server:
undefined method `searchable' for #<Class:0xce0bf80>
The stack trace is pointing to the searchable
block in the Model via the Contact.new
line in the controller.
When I run the code locally, either on the webpage or the console, or through the console on the Staging server, this error isn't appearing - only on the Staging webpage.
The Solr service is running fine on the Staging server, and the data has been indexed successfully. Any theories as to why it's not playing ball in Staging will be accepted.
EDIT
In response to Nick's question below, the Gemfile just has this line for Sunspot: gem 'sunspot_rails'
For Gemfile.lock, these are all the lines I could spot containing Sunspot or Solr references:
GEM
rsolr (0.12.1)
builder (>= 2.1.2)
sunspot (1.2.1)
escape (= 0.0.4)
pr_geohash (~> 1.0)
rsolr (= 0.12.1)
sunspot_rails (1.2.1)
nokogiri
sunspot (= 1.2.1)
DEPENDENCIES
sunspot_rails