"Connection refused" or "Address family not supported" error on Heroku
The issue affects some applications running on Aspen and using a .gems manifest to manage their gem dependencies.
It is due to the websolr-sunspot_rails gem being
updated on to a newer version. Unfortunately this version has an
incompatibility with an older dependency still present on the
system, causing the gem not to configure Sunspot correctly. The
"connection refused" message is due to Sunspot trying to connect to
its default of localhost.
There are two potential fixes for you while we work on a better solution within the gem itself.
1. Migrate to Bamboo + Bundler
This is an error we have only seen for applications running on the Aspen stack so far. The more thorough fix would be to migrate your app to the Bamboo stack, using Bundler for your gem dependencies.
Heroku stacks: http://docs.heroku.com/stack
Bundler on Rails 2.3 apps: http://gembundler.com/rails23.html
2. Explicitly override Sunspot default
If migrating to Bamboo and Bundler isn't an option for your
application, the quick fix is to add the following to your
production.rb config file:
config.after_initialize do
require "websolr-sunspot_rails"
Sunspot.config.solr.url = ENV["WEBSOLR_URL"]
end