title: cache: [GET /] miss? dalli gem, memcached, rails 3.1, nginx, unicorn production environment
body: <p>I'm struggling to get a first application running in production. No matter what I do I get a basic 404 page and this in my unicorn log, no matter what I do:</p>
  
  <blockquote>
  <pre><code>cache: [GET /] miss
  cache: [GET /something] miss
  </code></pre>
  </blockquote>
  
  <p>production.rb</p>
  
  <blockquote>
  <pre><code> config.cache_store = :dalli_store, 'localhost:11211'
   #config.cache_store = :memory_store
  </code></pre>
  </blockquote>
  
  <p>Everything worked fine in development (sans the caching which was skipped in development afaik), and doublechecking I have all the syntax correct as per rails guides for setting up controller action caching, only nothing but error messages.</p>
  
  <p>Can anyone give some pointers on perhaps why or what I'm missing? Works in development, but not on the server I set up. I'm more than happy providing more info for getting this sorted out. This is a lot moving parts to coordinate, I'd appreciate any input.</p>
  
  <p>edit: </p>
  
  <p>I went in for some feedback from memcached, running it with all previous options and -B binary (plus -vv) it seems that the program doesn't even connect with memcached; memcached registers nothing while the program is running.</p>
  
  <p>edit:</p>
  
  <p>I went back to a local setup in development and production; caching works, memcached responds, the only difference is I'm not running through nginx/unicorn just webrick, but if that helps to pinpoint an issue I'm to be aware of perhaps that is of some use and a direction to pursue.</p>
  
  <p>edit:</p>
  
  <p>Going back to the server, and then running in development mode with cache configurations enabled:</p>
  
  <blockquote>
    <p>config.cache_classes = true
    config.action_controller.perform_caching =
    true config.cache_store = :dalli_store, '127.0.0.1:11211'</p>
  </blockquote>
  
  <p>It is obvious that rails is not connecting with memcached. There is nothing in the log about even attempting to connect with the cache, and memcache run with -vv shows no activity. If I go to the console I can manually connect as per the dalli basic cli instructions, hmmm. Just trying various options with memcached instances yields no response.</p>
  
  <p>However, I can query memcached stats on an index page that comes up on each request where I've set it...though showing nothing in the rails log about accessing memcached.</p>
  
  <p>edit:</p>
  
  <p>wrestled through this, and found the error was unrelated....once I sorted through some asset pipeline issues for a misreferenced style sheet, everything seems to be running smoothly. A learning experience, at least.</p>