css - Heroku messing up styles -
i deployed ruby application heroku , noticed styles on herokuapp appeared not loading. pictures wouldn't show up, , looked terrible. how can fix this?
rails asset pipeline
the problem you're observing happens if rails asset pipeline not functioning properly: css references , photo urls returning 404 errors. way resolve precompile assets (css, js, image references) locally, prior pushing heroku.
asset precompile
to precompile assets on development platform production prior deploying heroku.
- include line in production.rb
config.assets.compile = false
- run assets precompile on development platform
$bundle exec rake assets:precompile ralis_env=production
- push heroku deploy
notes
- watch messages logged during heroku slug generation. should display 'assets precompiled, not compiling before generating slug...' (that's not exact language, message tells heroku has detected assets precompiled.)
- use browser debug inspector probe , see urls images. there, can see how asset s pipeline differs raw precompiled structure , filenames.
"the asset pipeline" documentation
rails documentation on asset pipeline here.
Comments
Post a Comment