【问题标题】:phoenix deployment with EXRM cowboy server answered 500凤凰部署与 EXRM 牛仔服务器回答 500
【发布时间】: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

【问题讨论】:

    标签: elixir phoenix-framework


    【解决方案1】:

    好的,我找到了我的麻烦的原因

    在主 OTP 中已经存在牛仔 cowlib 和牧场(在 /usr/lib/erlang/lib 目录中) 删除它们后 - 一切正常!

    凤凰规则!

    【讨论】:

    • 如果你的 Erlang 安装中有牛仔和牧场,你可能已经使用了 Erlang “企业发行版”,它被设计破坏并导致很多这样的麻烦。最好的解决方案是卸载它并安装“标准”版本。
    • tnx 供您参考。恐怕是我自己在和牛仔和chickagoBoss玩的时候自己把这些库放了
    • 如果我将 erlang 发行版安装为数据包(arhc linux,pacman),在这种情况下我是否有“企业发行版” //// 我会向谷歌询问“企业发行版”和 tnx u agn
    • 如果你用手玩,那我可能错了。如果您尚未使用此站点安装 Erlang:erlang-solutions.com/resources/download.html 不要介意我的评论 :)
    猜你喜欢
    • 2017-09-04
    • 2017-07-22
    • 2016-05-08
    • 1970-01-01
    • 1970-01-01
    • 2011-09-09
    • 1970-01-01
    • 1970-01-01
    • 2017-11-28
    相关资源
    最近更新 更多