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).
I have added gem 'rails_12factor' and tried toggling the config.serve_static_assets = true but to no avail (doesn't rails_12factor do that for you anyway?).
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):
The broken one is deployed to Heroku's "warm-chamber" and the one which does serve images is deployed to "serene-earth".
The one which isn't serving images also has some settings for Sendgrid in production.rb:
config.action_mailer.smtp_settings = { :address => 'smtp.sendgrid.net', :port => '587', :authentication => :plain, :user_name => ENV['SENDGRID_USERNAME'], :password => ENV['SENDGRID_PASSWORD'], :domain => 'heroku.com' } config.action_mailer.delivery_method ||= :smtpI can't imagine how that would affect anything meaningful.
The broken one has newrelic's
newrelic_rpmgem installed, the working one does not. It also makes use of the ENV variable management gemfigaroand MailChimp'sgibbongem, which the working app does not. Not sure how this would affect things, but you know better than I.
Final note: My first deploy after I'd added custom CSS and image files to the repo, even though I did have rails_12factor installed, showed some of the same strange errors as detailed in this SO post, though they went away on my next deploy despite no meaningful changes (which seemed pretty odd):
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)
What could cause the app to serve CSS and JS fine but not images?
Why would it be different between my two almost identical apps?