sunspot_rails宝石 - “ Errno :: ECONNREFUSED(Connection refused - connect(2))“ [英] sunspot_rails gem - " Errno:: ECONNREFUSED (Connection refused - connect (2)) "

查看:139
本文介绍了sunspot_rails宝石 - “ 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆