sunspot_rails宝石 - “ Errno :: ECONNREFUSED(Connection refused - connect(2))“ [英] sunspot_rails gem - " Errno:: ECONNREFUSED (Connection refused - connect (2)) "
问题描述
我使用gem sunspot_rails https://github.com/outoftime/sunspot
我按照 http://railscasts.com/episodes/278-搜索与黑子,但得到一个错误
Errno :: ECONNREFUSED(连接被拒绝 - connect(2)):
app / controllers / books_controller.rb:7:在'index'中
来自 books_controller.rb
def index
@search = Book.search do
fulltext params [:search]
end
@books = @ search.results
end
它可以是什么?
您是否开始使用Solr服务器?
< pre $
rake sunspot:solr:start
如果不是t首先开始solr服务器
如果是,则尝试
rake sunspot:solr:run
希望这会有所帮助。
I use gem sunspot_rails https://github.com/outoftime/sunspot I did everything according to the instructions on http://railscasts.com/episodes/278-search-with-sunspot, but get an error
Errno:: ECONNREFUSED (Connection refused - connect (2)): app/controllers/books_controller.rb: 7: in `index '
code from books_controller.rb
def index
@search = Book.search do
fulltext params[:search]
end
@books = @search.results
end
what it can be?
Have you started the Solr server?
rake sunspot:solr:start
If not than start the solr server first
And If yes than try
rake sunspot:solr:run
Hope this will help .
这篇关于sunspot_rails宝石 - “ Errno :: ECONNREFUSED(Connection refused - connect(2))“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!