CSS not loading in Heroku

后端 未结 3 1878
南旧
南旧 2021-02-06 02:42

I deployed my app to Heroku but only the assets\\images are loading. The CSS files (especially the one that contains 90% of the CSS, custom.css) are not being loaded. I precompi

相关标签:
3条回答
  • 2021-02-06 02:50

    Please make this changes config.serve_static_assets = true in your production.rb

    Please let me know what happen.hope it will work..

    Thanks

    0 讨论(0)
  • 2021-02-06 02:53

    How about making a change to application.css(.scss) (like adding new empty line) and committing that? It seems that Heroku is checking for the diff files and precompiles assets accordingly. I just happened to know it accidentally, so you can try if it helps.

    0 讨论(0)
  • 2021-02-06 03:04

    Update your gemfile with

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

    Install your bundle and push it to heroku

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

    It helps me when I had same problem.

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