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!

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

4 Comments

Thanks, how can I check to see if the cache is the problem?
You can clear browser's cache and load assets. and then, you should access latest assets. if you cannot, the problem is deployment.
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?
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.