CSS loading locally but not in Heroku for a rails app CSS loading locally but not in Heroku for a rails app ruby-on-rails ruby-on-rails

CSS loading locally but not in Heroku for a rails app


Run bundle exec rake assets:precompile on your local code

Commit the changes and deploy to heroku


Had the same exact problem, I don't know if it will help other in the future, but I got this on my "git push heroku master" push:

WARNINGS:

    Include "rails_12factor" gem to enable all platform features

Updated my gemfile,

    *group :production, :staging do      gem 'pg'      gem 'rails_12factor'    end*

Ran it again, to my delight it installed these:

    Installing rails_serve_static_assets (0.0.1)           Installing rails_stdout_logging (0.0.1)           Installing rails_12factor (0.0.2)

Site worked perfect after that. Hope that helps someone, I'm new to all this.


Check that in /config/environments/production.rb you have these set to true

config.cache_classes = trueconfig.serve_static_assets = trueconfig.assets.compile = trueconfig.assets.digest = true

git add, git commit and push to heroku.