首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用牛仔示例('noproc',ranch_listener_sup)启动应用程序时出错

使用牛仔示例('noproc',ranch_listener_sup)启动应用程序时出错
EN

Stack Overflow用户
提问于 2017-01-24 16:00:20
回答 1查看 406关注 0票数 1

我正在尝试运行牛仔示例,使用rebar3:牛仔版本2.0.0-pre.5

我所做的是:

  1. rebar3 new app hello_world
  2. 将示例src复制到src中。
  3. 更新rebar.config {cowboy,".*", {git, "https://github.com/ninenines/cowboy", {branch, "master"}}}
  4. rebar3 compile。一切都很好
  5. erl -pa _build/default/lib/*/ebin
  6. application:start(hello_world).

就会发生错误

代码语言:javascript
复制
{error,{bad_return,{{hello_world_app,start,[normal,[]]},
                    {'EXIT',{noproc,{gen_server,call,
                                                [ranch_sup,
                                                 {start_child,{{ranch_listener_sup,http},
                                                               {ranch_listener_sup,start_link,
                                                                                   [http,100,ranch_tcp,
                                                                                    [{connection_type,supervisor},{port,...}],
                                                                                    cowboy_clear,
                                                                                    #{connection_type => supervisor,...}]},
                                                               permanent,infinity,supervisor,
                                                               [ranch_listener_sup]}},
                                                 infinity]}}}}}}

=INFO REPORT==== 24-Jan-2017::18:34:52 ===
    application: hello_world
    exited: {bad_return,
                {{hello_world_app,start,[normal,[]]},
                 {'EXIT',
                     {noproc,
                         {gen_server,call,
                             [ranch_sup,
                              {start_child,
                                  {{ranch_listener_sup,http},
                                   {ranch_listener_sup,start_link,
                                       [http,100,ranch_tcp,
                                        [{connection_type,supervisor},
                                         {port,8080}],
                                        cowboy_clear,
                                        #{connection_type => supervisor,
                                          env => #{dispatch => [{'_',[],
                                                 [{[],[],toppage_handler,
                                                   []}]}]}}]},
                                   permanent,infinity,supervisor,
                                   [ranch_listener_sup]}},
                              infinity]}}}}}
    type: temporary

runch_sup似乎无法启动。我的方法怎么了?我希望运行与示例中完全相同的src代码。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-25 09:41:25

默认情况下,ranch1.3依赖于ssl应用程序。如果你不开始,牧场就不能开始了。在做ok = application:start(App)时,我建议在ok上进行匹配,这样您就可以更快地了解这个问题了。

埃森

这里是问题所在

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41832685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档