【发布时间】:2016-04-25 13:47:09
【问题描述】:
我的新项目(我只在默认 mix new proj 的主页上添加了“hello world”)在 dev 中运行良好
我根据 phoenix site 部分将其配置为 prod,然后使用此命令
MIX_ENV=prod iex -S mix phoenix.server
效果很好
之后我通过混合发布创建了发布 - 在此过程中一切都很好
之后我尝试启动此版本,它启动了,但没有工作:
$> rel/hello/bin/hello console
Using /home/bar/work/phoenix/hello/rel/hello/releases/0.0.1/hello.sh
Exec: /home/bar/work/phoenix/hello/rel/hello/erts-7.3/bin/erlexec -boot /home/bar/work/phoenix/hello/rel/hello/releases/0.0.1/hello
-mode embedded -config /home/bar/work/phoenix/hello/rel/hello/running-config/sys.config
-boot_var ERTS_LIB_DIR /home/bar/work/phoenix/hello/rel/hello/erts-7.3/../lib
-env ERL_LIBS /home/bar/work/phoenix/hello/rel/hello/lib
-pa /home/bar/work/phoenix/hello/rel/hello/lib/hello-0.0.1/consolidated
-args_file /home/bar/work/phoenix/hello/rel/hello/running-config/vm.args
-user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /home/bar/work/phoenix/hello/rel/hello
/home/bar/work/phoenix/hello/rel/hello
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
17:09:39.614 [info] Running Hello.Endpoint with Cowboy using http on port 4001
Interactive Elixir (1.2.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(hello@localhost)1> 17:09:42.545 [error] Ranch protocol #PID<0.1183.0> (:cowboy_protocol) of listener Hello.Endpoint.HTTP terminated
** (exit) {:cowboy_handler, [class: :error, reason: :undef, mfa: {Plug.Adapters.Cowboy.Handler, :init, 2},
stacktrace: [{Plug.Adapters.Cowboy.Handler, :init, [{:http_req, #Port<0.3806>,
:ranch_tcp, :keepalive, #PID<0.1183.0>, "GET", :"HTTP/1.1", ................
$> curl -v localhost:4001
* Rebuilt URL to: localhost:4001/
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4001 (#0)
> GET / HTTP/1.1
> Host: localhost:4001
> User-Agent: curl/7.48.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< server: Cowboy
< date: Fri, 22 Apr 2016 14:24:42 GMT
< content-length: 0
<
* Connection #0 to host localhost left intact
什么?如何? (我已阅读 phoenixframework.org 上的“部署”部分)
$> mix -v
Mix 1.2.4
$> elixir -v
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.2.4
Tnx
【问题讨论】: