Phoenix/Elixir/Ejabberd - 响应已发送错误

Nod*_*dal 8 elixir ejabberd phoenix-framework

我正在按照本指南将Ejabberd嵌入Phoenix应用程序(https://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/),我现在遇到错误它正在运行.

基本上,一切似乎工作正常,直到我导航到" http:// localhost:4000/ejabberd ",此时我收到以下错误:

[error] #PID <0.721.0>运行EjbrdTest.Endpoint终止服务器:localhost:4000(http)请求:GET/ejabberd**(退出)引发异常:**(Plug.Conn.AlreadySentError)响应是已发送(插件)lib/plug/conn.ex:428:Plug.Conn.resp/3(插件)lib/plug/conn.ex:415:Plug.Conn.send_resp/3(ejbrdTest)web/controllers/ejabberd_controller .ex:1:EjbrdTest.EjabberdController.phoenix_controller_pipeline/2(ejbrdTest)lib/phoenix/router.ex:265:EjbrdTest.Router.dispatch/2(ejbrdTest)web/router.ex:1:EjbrdTest.Router.do_call/2 (ejbrdTest)lib/ejbrdTest/endpoint.ex:1:EjbrdTest.Endpoint.phoenix_pipeline/1(ejbrdTest)lib/plug/debugger.ex:90:EjbrdTest.Endpoint."call(overridable 3)"/ 2(ejbrdTest)lib /phoenix/endpoint/render_errors.ex:34:EjbrdTest.Endpoint.call/2(插件)lib/plug/adapters/cowboy/handler.ex:15:Plug.Adapters.Cowboy.Handler.upgrade/4(cowboy)src/cowboy_protocol.erl:442 :: cowboy_protocol .execute/4

而不是用户列表,我在jumbotron中看到了这一点:

在线用户:<%=用户< - @users do%> <%=用户%>

<%end%>

我没有找到任何关于此的内容,任何想法?

谢谢.如果您需要更多信息,请告诉我.

小智 12

删除plug :action将解决问题.看起来它现在默认调用,因此该行会导致重复错误:

https://github.com/phoenixframework/phoenix/issues/888


Mic*_*ond 1

该博客文章存在渲染问题(现已修复)。< 和 % 之间没有空格。

您可以从 Gist 下载实际的源代码:https://gist.github.com/mremond/383666d563025e86adfe#file-index-html-eex