Unicorn triggers mongoid error during assets precompile

后端 未结 2 1787
悲哀的现实
悲哀的现实 2020-12-17 19:22

I have a rails app using Mongoid 3 running on Heroku. I\'ve just updated it to use Unicorn. When I try to deploy it to Heroku I get the following error :

Run         


        
相关标签:
2条回答
  • 2020-12-17 19:38

    As I recently had this problem with Rails 4.0 and config.assets.initialize_on_precompile = false no longer has any effect with Rails 4.0 I spoke with Heroku support and was told to use this labs feature:

    heroku labs:enable user-env-compile
    

    I wasn't able to get an answer as to why the user environment is necessary only with Unicorn but it seems to be a Unicorn specific problem of some sort or Thin does something that prevents the entire app from booting.

    The whole thing seems odd to me and smells of a problem with the way assets are pre-compiled.

    0 讨论(0)
  • 2020-12-17 19:43

    Rails 3:

    Try to turn off app initialization when pre-compiling assets:

    # config/application.rb
    config.assets.initialize_on_precompile = false
    

    The line should already be there commented out.

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