我有一个简单的 phoenix 应用程序,我尝试使用exrm
. 当我使用该应用程序运行它时,它运行良好
mix phoenix.start
但是在使用它构建之后
mix release
(完成没有错误),运行可执行文件返回错误:
rel/my_app/bin/my_app foreground
Exec: /home/ubuntu/projects/my_app/rel/my_app/erts-6.0/bin/erlexec -noshell -noinput +Bd -boot /home/ubuntu/projects/my_app/rel/my_app/releases/0.0.1/my_app -mode embedded -config /home/ubuntu/projects/my_app/rel/my_app/releases/0.0.1/sys.config -args_file /home/ubuntu/projects/my_app/rel/my_app/releases/0.0.1/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- foreground
Root: /home/ubuntu/projects/my_app/rel/my_app
Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
{"Kernel pid terminated",application_controller,"{application_start_failure,my_app,{bad_return,{{'Elixir.MyApp',start,[normal,[]]},{'EXIT',{undef,[{'Elixir.MyApp',start,[normal,[]],[]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,272}]}]}}}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,my_app,{bad_return,{{'Elixir.MyApp',start,[normal,[]]},{'EXIT',{undef,[{'Elixir.MyApp',start,[normal,[]],[]},{application
我的mix.exs
样子是这样的:
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[ app: :my_app,
version: "0.0.1",
elixir: "~> 0.13.2",
deps: deps ]
end
# Configuration for the OTP application
def application do
[
mod: { MyApp, [] },
applications: [:phoenix]
]
end
# Returns the list of dependencies in the format:
# { :foobar, git: "https://github.com/elixir-lang/foobar.git", tag: "0.1" }
#
# To specify particular versions, regardless of the tag, do:
# { :barbat, "~> 0.1", github: "elixir-lang/barbat" }
defp deps do
[
{:phoenix, "0.2.4"},
{:jazz, github: "meh/jazz", ref: "7af3b74e58eb1a3fc6b9874a2077efa420f6dfcc"},
{:cowboy, github: "extend/cowboy", override: true, ref: "05024529679d1d0203b8dcd6e2932cc2a526d370"},
#{ :redis, "1.1.0", [ github: "timbuchwaldt/elixir-redis"] },
{:erlcloud,github: "gleber/erlcloud"},
{ :json, github: "cblage/elixir-json" },
{ :amnesia, github: "uriagassi/amnesia" },
{ :exrm, "~> 0.8.1"}
]
end
end
并my_app.ex
包含start/2
:
defmodule MyApp do
use Application.Behaviour
# See http://elixir-lang.org/docs/stable/Application.Behaviour.html
# for more information on OTP Applications
def start(_type, _args) do
MyApp.Supervisor.start_link
end
end
有任何想法吗?