【发布时间】:2021-02-16 05:46:08
【问题描述】:
背景
我正在通过mix release 创建一个伞式应用程序的发布。但是,即使我可以手动运行该应用程序,启动它时也会出现一些错误。
mix release
我正在尝试使用mix release 运行应用程序。此命令工作正常,它在_build/prod/rel/my_app/bin/my_app 中创建可执行文件。我可以使用命令start 运行这个可执行文件,并且一切运行良好。
但是,如果我使用start_iex 而不是start,我首先会出错,然后应用程序会正常运行:
$ _build/prod/rel/my_app/bin/my_app start_iex
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
*** ERROR: Shell process terminated! (^G to start new job) ***
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
my_app 是一款综合应用。这是伞应用程序的mix.exs 内容:
defmodule MyApp.MixProject do
use Mix.Project
def project do
[
apps_path: "apps",
version: "0.1.0",
start_permanent: Mix.env() == :prod,
deps: deps(),
elixir: "~> 1.10",
releases: releases()
]
end
defp deps, do: []
defp releases, do:
[
my_app: [
applications: [
api: :permanent,
core: :permanent,
storage: :permanent
]
]
]
end
问题
- 为什么我在使用
start_iex时会出错,而在使用start时却没有? - 为什么
start_iex会在出错后工作?
【问题讨论】:
-
谢谢!如果你把它作为答案,我会接受它!
标签: elixir release elixir-mix