title: How to properly diagnose a 500 error (Rails, Passenger, Nginx, Postgres)
body: <p>I'm having a real tough time diagnosing a 500 error from my application running in production. I've had it working before, but after re-deploying via Capastrano I am unable to get it going.</p>
  
  <p>Here are the facts:</p>
  
  <ol>
  <li>The server is setup with nginx + passenger, and I'm using
  PostgreSQL.</li>
  <li>Static assets are working properly, as in I'm able to access them just fine in a browser.</li>
  <li>I can access the rails console via <code>RAILS_ENV=production bundle exec rails console</code> and perform Active Record actions (like
  retrieving data from the db).</li>
  <li>Within console, I can run <code>app.get("/")</code>, which returns a 500 error as well (after first showing the query that was run to load
  the model).</li>
  <li>The production.log file is never written to. I've set permissions 777 on it just for the hell of it. I've also set the log level to
  :debug with nothing to show for it.</li>
  <li>The nginx log (which passenger also uses) shows no indication of errors, it just notifies about cache misses.</li>
  </ol>
  
  <p>Because nothing of use is being logged, I have no idea what to do here. I've tried setting full permission on the entire app directory with no help. Restarted the server multiple times, nothing. The database is there and rails can clearly communicate with it. I'm not sure what I did to get it to run the first time around. I just don't know why rails isn't outputting <em>anything</em> to the log.</p>