mperham/dalli — Issue #150: Default "localhost" doesn't work if localhost has an IPv6 address
Author: jaylevitt
Created: 2011-12-09 23:59:44+00:00
State: open

You mentioned in #42 that OS X has an IPv6 address for localhost that confuses dalli, and now I've seen it on a fresh Ubuntu Oneiric 64-bit install:

$ host localhost
localhost has address 127.0.0.1
localhost has IPv6 address ::1
$ rails c
1.9.3p0 :001 > Rails.cache.clear
Dalli::NetworkError: localhost:11211 is down:

When I switch to:

config.cache_store = :dalli_store, "127.0.0.1:11211"

it starts working. Maybe that should be the default, since there's probably nobody that's running memcached solely for an IPv6 localhost?