Unicorn triggers mongoid error during assets precompile

邮差的信 提交于 2019-11-29 06:20:53

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!