My Mac battery ran out while I was running a Rails 3 app, and after I plugged my Mac in and restarted it, I tried running my Rails app’s development server (using mysql for the database). Upon trying to update something, I got “Errno::ECONNREFUSED (Connection refused – connect(2))”. It turns out that I get this every time I try to post or update now.
There doesn’t seem to be any actual problem with the database. I can create new rails apps that work with sqlite, mysql, or postgres, but this old app, which worked fine before, can’t work with any of the databases, and I get the same “Connection refused – connect(2)” error no matter which I try. I’ve never seen this error before, I should note. Also, I don’t know that it would matter, but I’m running Rails 3.0.1 on Ruby 1.9.2.
Does anyone know what went wrong? Something went sideways, but I’m at a loss, losing hair and sleep…
The same thing just happened to me. Im sure you’ve already solved this by now, but this worked for me; try this in your terminal:
rake sunspot:solr:start
rake sunspot:solr:stop
rake sunspot:solr:start
Starting sunspot then killing the process didn’t fix the problem. When I stopped it through a rake task then restarted it, it did.