Rails + Heroku : We're sorry, but something went wrong

后端 未结 2 935
小蘑菇
小蘑菇 2021-01-23 12:25

Hi this is my first time trying to push a project up to Heroku and I am getting the error: We\'re sorry, but something went wrong. I\'m not sure how to read the her

相关标签:
2条回答
  • 2021-01-23 12:43

    First, a couple of pointers. The message We're sorry, but something went wrong is what Heroku presents to the end user on any error in your application, because you're in production mode. This is different than what happens in development mode on your local machine, on the theory that you don't want to expose debug stack traces to any user of your application who comes along.

    The deprecation warning is a red herring; it's about some gems that Heroku injects into every Rails application, to integrate with their log management stuff.

    The really pertinent line in your error log is this one:

    2012-10-23T20:29:56+00:00 app[web.1]: ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required):
    

    That's an error somewhere in how stylesheets are being handled, maybe in the asset pipeline feature. That's why @evanc3 is asking about how many stylesheets you have. And, I confess, I don't know how to debug this issue - so this is only a partial answer. Hopefully I've gotten you on the right path.

    0 讨论(0)
  • 2021-01-23 12:44

    Google with WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.

    I found this answer: https://stackoverflow.com/a/12859696/1008230
    Looks like the assets need be compile locally.

    Here's some reference:

    For faster asset precompiles, you can partially load your application by setting config.assets.initialize_on_precompile to false in config/application.rb, though in that case templates cannot see application objects or methods. Heroku requires this to be false.

    http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

    While precompiling assets, in Rails 3.1.1 and up, you can prevent initializing your application and connecting to the database by ensuring that the following line is in your config/application.rb: config.assets.initialize_on_precompile = false

    https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar#troubleshooting

    Haven't try it myself, hope that helps.

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