Я пытаюсь создать приложение с помощью sunspot_solr и получаю эту ошибку:
rsolr (0.12.1) lib/rsolr/connection/requestable.rb:39:in `request'
rsolr (0.12.1) lib/rsolr/client.rb:34:in `request'
sunspot (1.2.1) lib/sunspot/search/abstract_search.rb:35:in `execute'
sunspot_rails (1.2.1) lib/sunspot/rails/searchable.rb:306:in `solr_execute_search'
sunspot_rails (1.2.1) lib/sunspot/rails/searchable.rb:139:in `solr_search'
app/controllers/search_controller.rb:7:in `results'
Вот мой sunspot.yml:
solr:
hostname: localhost
port: 8980
log_level: INFO
path: /solr
pid_dir: /solr/pids/development
auto_commit_after_delete_request: true
И экземпляр solr вhttp://localhost:8980/solr/admin/ работает, я получаю все желаемые результаты при выполнении запросов там.Но когда я запускаю свое приложение, я получаю вышеуказанную ошибку.
Моя конфигурация: Rails 3.1.1 Sunspot: 1.2.1
Пожалуйста, дайте мне знать, какая еще информация вам нужна от меня, и спасибозаранее за ответы.
Я просмотрел файлы журналов и обнаружил эту ошибку:
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <class:User> at /home/romio/hummingtown_v1/app/models/user.rb:17)
Вот мой user.rb:
require 'digest/sha2'
class User < ActiveRecord::Base
has_many :userauths, :dependent => :destroy
attr_accessor :password
attr_accessible :first_name, :last_name, :email, :password, :salt
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :first_name, :presence => true, :length => { :maximum => 50 }
validates :last_name, :presence => true, :length => { :maximum => 50 }
validates :email, :presence => true, :format => { :with => email_regex },
:uniqueness => { :case_sensitive => false }
searchable :auto_index => true, :auto_remove => true do
text :first_name, :default_boost => 2
text :last_name
text :email
end