0

Any idea why my custom.css would work perfectly in my development environment, but not work when deployed to Heroku? Things that have the property display: none; are appearing when deployed, but are appropriately hidden when in development.

Thanks!

jackerman09
  • 2,492
  • 5
  • 29
  • 46

2 Answers2

4

Sounds like you are having problems with the asset pipeline. Check out:

https://devcenter.heroku.com/articles/rails-asset-pipeline

Are you letting Heroku precompile your assets? Personally, I precompile all my assets before deploying to Heroku.

RAILS_ENV=production bundle exec rake assets:precompile

This will precompile all your assets and puts it under a public/assets folder. Then you can just add them to git and push to heroku.

If you do this you will be compiling manually, and you should run the precompile line before you re-deploy or update your Heroku app to catch any changes you've made in the asset pipeline.

ChrisBarthol
  • 4,871
  • 2
  • 21
  • 24
1

You can check belows - expire browser cache. - check assets are deploy well. (access to css url directly)

I think that case is almost come from cache.

humbroll
  • 347
  • 1
  • 10
  • Thanks, how can I check to see if the cache is the problem? – jackerman09 Oct 04 '13 at 19:16
  • You can clear browser's cache and load assets. and then, you should access latest assets. if you cannot, the problem is deployment. – humbroll Oct 04 '13 at 19:22
  • Sorry, but this is my first real deployment, so I'm still a little lost with what you're suggesting. How do I 'load the assets', as you suggested? – jackerman09 Oct 04 '13 at 19:37
  • 1
    Several solution. You can inspect web page with browsers 'inspector' feature. Then, you can get some asset(css or javascript)'s url. Now you can load the url in browser. Did you check "config.serve_static_assets = true" in /config/environments/production.rb? if you set 'false' to serve_static_assets, that's the problem. – humbroll Oct 04 '13 at 20:49