我有一个类似的问题,Solr with Rails - rake sunspot:reindex 不起作用。
我的 Gemfile 中有这些:
gem 'sunspot_solr', github: 'sunspot/sunspot', branch: 'master'
gem 'sunspot_rails', github: 'sunspot/sunspot', branch: 'master'
和:
bundle exec rake sunspot:solr:start
工作正常,但是当我这样做时:
bundle exec rake sunspot:solr:reindex
我得到:
Connection refused - {:data=>
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Service</query></delete>",
:headers=>{"Content-Type"=>"text/xml"}, :method=>:post, :params=>{:wt=>:ruby},
:query=>"wt=ruby", :path=>"update", :uri=>
#<URI::HTTP:0x007fccf982f348 URL:http://localhost:8982/solr/default/update?wt=ruby>,
:open_timeout=>nil, :read_timeout=>nil, :retry_503=>nil,
:retry_after_limit=>nil}