Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Elixir phoenix部署与EXRM cowboy服务器_Elixir_Phoenix Framework - Fatal编程技术网

Elixir phoenix部署与EXRM cowboy服务器

Elixir phoenix部署与EXRM cowboy服务器,elixir,phoenix-framework,Elixir,Phoenix Framework,我的新项目(我在默认的mixnewproj主页上添加了“helloworld”)在dev中运行良好 我根据phoenix站点部分为prod配置了它,之后使用这个命令 MIX_ENV=prod iex -S mix phoenix.server 它很好用 在那之后,我创建了一个又一个的混合发布——在这个过程中一切都很顺利 在此之后,我尝试启动此版本,但它启动了,但不起作用: $> rel/hello/bin/hello console Using /home/bar/work/phoen

我的新项目(我在默认的mixnewproj主页上添加了“helloworld”)在dev中运行良好

我根据phoenix站点部分为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

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

在主要OTP中已经存在牛仔牛仔库和牧场(in/usr/lib/erlang/lib dir) 移除它们后,一切都会好起来


凤凰城规则

如果您的Erlang安装中有cowboy and ranch,那么您可能已经使用了Erlang“企业发行版”,这种发行版在设计上有缺陷,并且会导致许多类似的问题。最好的解决方案是卸载它并安装“Standard”one.tnx以供参考。我担心,当我与cowboy和Chickagobos一起玩时,我会亲手把这些LIB放在手上。如果我将erlang发行版安装为packet(arhc linux,pacman),那么在这种情况下我是否有“企业发行版”///好吧,我会问谷歌关于“企业发行版”和tnx u Agn的问题,如果你用手玩的话,那么我可能错了。如果您没有使用此站点安装Erlang:请不要介意我的评论:)
$> 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