title: Rails 4 app on Heroku is serving CSS and JS but not image assets
body: <p>I've deployed a Rails 4 app to Heroku and it serves my CSS and JS assets just fine but cannot find the images (404).</p>
  
  <p>I have added <code>gem 'rails_12factor'</code> and tried toggling the <code>config.serve_static_assets = true</code> but to no avail (doesn't <code>rails_12factor</code> do that for you anyway?).</p>
  
  <p>The strangest part is that it is nearly identical to another Rails 4 app I very recently deployed which has no issues with the assets. There are only a few differences between the two apps (from a config standpoint):</p>
  
  <ol>
  <li><p>The broken one is deployed to Heroku's "warm-chamber" and the one which does serve images is deployed to "serene-earth".</p></li>
  <li><p>The one which isn't serving images also has some settings for Sendgrid in production.rb:</p>
  
  <pre><code>config.action_mailer.smtp_settings = {
  :address        =&gt; 'smtp.sendgrid.net',
  :port           =&gt; '587',
  :authentication =&gt; :plain,
  :user_name      =&gt; ENV['SENDGRID_USERNAME'],
  :password       =&gt; ENV['SENDGRID_PASSWORD'],
  :domain         =&gt; 'heroku.com'
  }
  config.action_mailer.delivery_method ||= :smtp
  </code></pre>
  
  <p>I can't imagine how that would affect anything meaningful.</p></li>
  <li><p>The broken one has newrelic's <code>newrelic_rpm</code> gem installed, the working one does not.  It also makes use of the ENV variable management gem <code>figaro</code> and MailChimp's <code>gibbon</code> gem, which the working app does not.  Not sure how this would affect things, but you know better than I.</p></li>
  </ol>
  
  <p><strong>Final note</strong>: My first deploy after I'd added custom CSS and image files to the repo, even though I did have <code>rails_12factor</code> installed, showed some of the same strange errors as detailed in <a href="https://stackoverflow.com/questions/15354539/heroku-does-not-compile-files-under-assets-piplines-in-rails-4">this SO post</a>, though they went away on my next deploy despite no meaningful changes (which seemed pretty odd):</p>
  
  <pre><code>    Running: rake assets:precompile
      I, [2013-10-05T04:25:02.831526 #626]  INFO -- : Writing /tmp/build_0eea2e50-5876-4521-b7f6-7ca902cb129b/public/assets/bg-c63ed011f04c5167903c6d603521adfb.jpg
      I, [2013-10-05T04:25:02.836773 #626]  INFO -- : Writing /tmp/build_0eea2e50-5876-4521-b7f6-7ca902cb129b/public/assets/coding_school-3bcbdaea6f8c23b774d27df4b608647a.jpg
      I, [2013-10-05T04:25:02.840352 #626]  INFO -- : Writing /tmp/build_0eea2e50-5876-4521-b7f6-7ca902cb129b/public/assets/down_arrow_select-0b10b4ac52a74389bbc3abbb3a8cde7a.jpg
      I, [2013-10-05T04:25:03.013966 #626]  INFO -- : Writing /tmp/build_0eea2e50-5876-4521-b7f6-7ca902cb129b/public/assets/application-0c6f0f27ac77563741a04576653d7c0e.css
      Asset precompilation completed (3.22s)
  </code></pre>
  
  <p>What could cause the app to serve CSS and JS fine but not images? </p>
  
  <p>Why would it be different between my two almost identical apps?</p>