【问题标题】:Error during starting the application with cowboy example ('noproc', ranch_listener_sup)使用牛仔示例启动应用程序时出错('noproc',ranch_listener_sup)
【发布时间】:2017-06-09 12:25:01
【问题描述】:

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

我做的是:

  1. rebar3 new app hello_world
  2. 将示例源复制到我的源中
  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 代码。

【问题讨论】:

  • 自述文件建议以make run 开始示例。这行得通吗?
  • 没有。我现在还没有机会。稍后会尝试这样做

标签: erlang erlang-otp cowboy rebar3


【解决方案1】:

Ranch 1.3 默认依赖 ssl 应用程序。如果你不 启动它,牧场无法启动。我建议在 ok 时匹配 做 ok = application:start(App),你早就知道这个问题了 更快。

essen

here 是问题

【讨论】:

    猜你喜欢
    • 2013-09-17
    • 2016-03-07
    • 2014-04-01
    • 2015-08-12
    • 1970-01-01
    • 1970-01-01
    • 2014-06-10
    • 2013-11-05
    • 2017-09-04
    相关资源
    最近更新 更多