title: Rails + Dalli memcache gem: DalliError: No server available
body: <p>Hi I'm having trouble setting up my Rails project on my server because apache keeps complaining</p>
  
  <p><code>DalliError: No server available</code>. </p>
  
  <p>I installed <code>memcached</code> on my ubuntu machine, but it still doesn't work. My rails project also has <code>config.cache_store = :dalli_store, 'localhost:11211', { :namespace =&gt; "production" }</code> in environments/production.rb. How would I debug this?</p>
  
  <p>My log shows before each request:</p>
  
  <pre><code>localhost:11211 failed (count: 6)
  DalliError: No server available
  </code></pre>
  
  <p>telnet to 11211:</p>
  
  <pre><code>    root@s2:/usr/local/www/production/current/log# telnet localhost 11211
      Trying 127.0.1.1...
      telnet: Unable to connect to remote host: Connection refused
  </code></pre>