Missing CSS on Heroku Deployment
I've followed along and was able to finally push my app to Heroku and test it out.
It seems that it is not loading up the bootstrap CSS. I've double checked with git status, and everything is added and happy. Also, everything looks fine on my GitHub remote for this (http://github.com/sean-perryman/treebook). Any thoughts on resolving this missing CSS issue?
I asked the question over on StackOverflow, and was given the answer. By default, the Rails app is configured to compile your assets (CSS, etc) on the fly. Heroku does not do this, hence the need to precompile your assets before pushing them to the production site. One thing that was overlooked (I think) was to change the
config.serve_static_assets setting in the
config/environments/production.rb file to true. After doing this, and repushing the files to Heroku, everything started working.
Tim KnightTreehouse Moderator 28,749 Points
Sean, make sure you're precompiling your Sass and CSS assets. Heroku won't compile those on-the-fly like it does in your development environment. From the terminal (within your project folder) you'd write:
I hadn't done that, but I went ahead and did and after the push it still seems the same. I am sure I am just missing something simple.
Using the Firefox console, it seems to be having issues with loading the CSS and JS files that are labeled
'application-73b133c60d8b44702a1aea753db41f19.css' and 'application-4dc704670cd76f40f1697bd36a2d3c02.js'
Now I see those in my GitHub repo in the public/assets directory, is there a way to push just those files up? Perhaps I will try adding a comment in both of those files, re-committing, and re-pushing and see if that will work.