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

Error during starting the application with cowboy example ('noproc', ranch_listener_sup)

我正在尝试 运行 this 使用 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).

然后出现错误

{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 代码。

Ranch 1.3 depends on the ssl application by default. If you don't start it, Ranch fails to start. I would recommend matching on ok when doing ok = application:start(App), you'd have known the issue much quicker.

来自 essen

here 是问题