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.

  1. include line in production.rb
config.assets.compile = false 
  1. run assets precompile on development platform
$bundle exec rake assets:precompile ralis_env=production 
  1. 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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -