Distillery部署,dependencies are missing from applications

$ mix release --warnings-as-errors --env=prod (/root/yii)
==> Assembling release..
==> Building release yii:0.0.1483409080 using environment prod
==> One or more direct or transitive dependencies are missing from
    :applications or :included_applications, they will not be included
    in the release:

使用Distillery发布时,通常会遇到向上面这样的问题。

原因是Distillery不会偷偷地将dependencies加入applications中,因为它们是两类东西。例如你在compile时期需要某些dependency,但是不想加入到release中,比如distillery本身就是building中不可缺少的。这导致了一个潜在的问题,dependencies可以定义模块的on_load回调函数,这会导致运行时不能预期的代码,甚至有可能阻止release的启动。

The warning you see in the output is intended to let you know when one is missing. I went back and forth on this, but after a conversation with a number of people on IRC, I realized that there are a couple of situations where doing that is not desired, and having an opt-out mechanism is just as much pain as an opt-in mechanism, except we already have the opt-in mechanism, and one that many people are used to at this point.

比如使用ex_admin,在部署的时候就会遇到这些问题,这时只要根据提示,将
:ex_admin, :exactor, :hound加入到application中去即可。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容