TiSer TiSer - 2 years ago 206
Ruby Question

sunspot_rails gem - " Errno:: ECONNREFUSED (Connection refused - connect (2)) "

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]
@books = @search.results

what it can be?

Vik Vik
Answer Source

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 .

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download