CSS loading locally but not in Heroku for a rails app

后端 未结 11 1802
梦谈多话
梦谈多话 2020-12-04 09:12

I\'m following a rails prelaunch signup tutorial. Bootstrap was working fine deployed on heroku, but then I modified the bootstrap_and_override file to include a logo. Whe

相关标签:
11条回答
  • 2020-12-04 09:39

    I just went through similar problems with an app. Check out THIS post...

    0 讨论(0)
  • 2020-12-04 09:42

    Run bundle exec rake assets:precompile on your local code

    Commit the changes and deploy to heroku

    0 讨论(0)
  • 2020-12-04 09:44

    I got the same problem in rails4 fixed with adding a. gem 'rails_12factor' b. bundle exec rake assets:precompile

    0 讨论(0)
  • 2020-12-04 09:52

    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.

    0 讨论(0)
  • 2020-12-04 09:53

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

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

    git add, git commit and push to heroku.

    0 讨论(0)
  • 2020-12-04 09:54

    Figured it out after trying about everything stackoverflow could suggest. I simply checked git status, saw I had a bunch of uncommitted files (thought this would have been picked up by git push heroku master), then added, committed and pushed to git. Then I started over, ran bundle install, precompiled assets and deployed to heroku and it is working.

    0 讨论(0)
提交回复
热议问题