images precompiled, heroku keeps complaining on some
-
22-06-2021 - |
Pregunta
I added an image to the /app/assets/images folder, logo-small.jpg
Then I added this line to my view
= link_to image_tag('logo-small.jpg'), root_path, :class => 'brand'
Then I precompiled,
rake assets:precompile RAILS_ENV=production
git add, git commit and git push heroku master. the push works.
I'm still getting the error
ActionView::Template::Error (logo-small.jpg isn't precompiled):
why?
EDIT: I've tried other images, they're fine. Heroku has an issue with logo and logo-small, but not with other images. wtf??
Solución 2
never found out what it was. switched the format from jpg to png and it worked.
Otros consejos
If you are on heroku's Cedar stack, your assets should be automatically precompiled when you push to heroku. If you're on that stack and still getting errors, that would be good to know.
If you're on the Bamboo stack (which is a little bit older but used to be the default), you can try running a rake task on the server to have it compile the assets that you've already pushed.
heroku run rake assets:precompile