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

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容