$ 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中去即可。