Jeff Wilkey Jeff Wilkey - 4 months ago 38
Ruby Question

ActionController::RoutingError (No route matches [GET] "/assets/blah.png") Heroku

I've seen this error run into a few times in multiple different threads here but although after trying almost all of the mentioned solutions I'm still hitting multiple of these errors within my

heroku logs
.


It should be noted that I'm using rails 4.2.


The interesting thing is the images within the
HTML
load fine, however the images that are attempting to be accessed from my
SCSS
files do not load at all and I hit the following error on those files.

ActionController::RoutingError (No route matches [GET] "/assets/roses-right.png"):


As I've said I've tried multiple solutions including running
rake assets:precompile
both locally and on the heroku server. I've also attempted setting
config.serve_static_files = true
within
config/environments/production.rb
and still no dice. And lastly within my gemfile I do have the following block:

group :production do
gem 'pg'
gem 'rails_12factor'
end


Any help here would be greatly appreciated, thanks.

Answer

You need to change in your scss to use the sass helpers that the gem provides, like:

image-path('roses-right.png')

Check the docs at https://github.com/rails/sass-rails#asset-helpers

Comments