我正在尝试使用rebar3运行this牛仔示例: 牛仔版2.0.0-pre.5
我的工作是:
rebar3 new app hello_world
{cowboy,".*", {git, "https://github.com/ninenines/cowboy", {branch, "master"}}}
rebar3 compile
。一切都很顺利erl -pa _build/default/lib/*/ebin
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代码。