title: Rails not serving assets in production or staging environments
body: <p>In the process of debugging <a href="https://stackoverflow.com/questions/15177834/css-styles-not-being-compiled-for-rails-assets">this problem</a>, I have tried to run my application in production mode locally and it doesn't serve up any assets. Additionally, I have a <strong>staging</strong> environment in a Heroku application (separate from my production Heroku application) which is also now displaying the HTML without any assets.</p>
  
  <p>To debug, I:</p>
  
  <ol>
  <li>Kill the server</li>
  <li>Clear out tmp/cache/assets</li>
  <li>Delete public/assets</li>
  <li>Run <code>rake assets:precompile</code></li>
  <li>Start up the server <code>rails s -e production</code></li>
  <li>Visit the page and open up web inspector and when clicking the expand arrow for the application.css link it says <code>Reload the page to get source for: http://localhost:3000/assets/application-e1f3e0c864a153c7iu66f8772a886376.css
  </code></li>
  <li>Reloading the page does nothing.</li>
  </ol>
  
  <p><strong>Production.rb</strong>:</p>
  
  <pre><code>config.cache_classes = true
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.serve_static_assets = true
  config.static_cache_control = "public, max-age=3600"
  config.assets.compress = false
  config.assets.compile = false
  config.assets.digest = true
  </code></pre>
  
  <p><strong>Staging.rb</strong>:</p>
  
  <pre><code>config.cache_classes = true
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.serve_static_assets = true
  config.static_cache_control = "public, max-age=3600"
  config.assets.compress = false
  config.assets.compile = false
  config.assets.digest = true
  </code></pre>
  
  <p><strong>Application.rb</strong>:</p>
  
  <pre><code>config.assets.enabled = true
  config.assets.version = '1.0'
  config.assets.initialize_on_precompile = false
  </code></pre>
  
  <p>Below is how I link the stylesheet and javascript in <em>layout/application.html.erb</em>:</p>
  
  <pre><code>&lt;%= stylesheet_link_tag "application", :media =&gt; "screen, handheld" %&gt;
  &lt;%= javascript_include_tag "application" %&gt;
  </code></pre>