2017-01-01 18 views
0

私は自分のサーバーを稼動しようとしています。私はsrcファイルを新しいカウボーイのインストールにコピーしました。これは私が得ているエラーです。私のカウボーイサーバーが稼働していないのはなぜですか?

~/cowboy_ninja:.ls src 
action_handler.erl gate.beam  resolution.beam 
arena.beam  gate.erl  resolution.erl 
arena.erl  guestbook.beam  temple.beam 
cowboy_ninja_app.erl guestbook.erl  temple.erl 
cowboy_ninja_sup.erl hello_handler.erl 
~/cowboy_ninja:. 

猫のsrc/cowboy_ninja_app.erl

-module(cowboy_ninja_app). 
-behaviour(application). 

-export([start/2]). 
-export([stop/1]). 

start(_Type, _Args) -> 
    Dispatch = cowboy_router:compile([ 
     {'_', [ 
     {"/action", action_handler, []}, 
     {"/join", hello_handler, []}]} 
    ]), 
    {ok, _} = cowboy:start_clear(my_http_listener, 100, 
     [{port, 8080}], 
     #{env => #{dispatch => Dispatch}} 
    ), 
    {ok, Pid} = gate:start_link(), 
    register(gate, Pid), 
    {ok, Guestbook} = guestbook:start_link(), 
    register(guestbook, Guestbook), 
    gate:action(Pid, {fight}), 
    cowboy_ninja_sup:start_link(). 

stop(_State) -> 
    ok. 

下記を参照してください。

~/cowboy_ninja:.gmake run 
===> Starting relx build process ... 
===> Resolving OTP Applications from directories: 
      /Users/quantum/cowboy_ninja/ebin 
      /Users/quantum/cowboy_ninja/deps 
      /usr/local/Cellar/erlang/19.1/lib/erlang/lib 
      /Users/quantum/cowboy_ninja/apps 
      /Users/quantum/cowboy_ninja/_rel 
===> Resolved cowboy_ninja_release-1 
===> Including Erts from /usr/local/Cellar/erlang/19.1/lib/erlang 
===> release successfully created! 
===> tarball /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release/cowboy_ninja_release-1.tar.gz successfully created! 
Exec: /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release/erts-8.1/bin/erlexec -boot /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release/releases/1/cowboy_ninja_release -mode embedded -boot_var ERTS_LIB_DIR /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release/erts-8.1/../lib -config /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release/releases/1/sys.config -args_file /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release/releases/1/vm.args -- console 
Root: /Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release 
/Users/quantum/cowboy_ninja/_rel/cowboy_ninja_release 
heart_beat_kill_pid = 52128 
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 


=INFO REPORT==== 1-Jan-2017::17:03:57 === 
    application: cowboy_ninja 
    exited: {bad_return, 
       {{cowboy_ninja_app,start,[normal,[]]}, 
       {'EXIT', 
        {undef, 
         [{cowboy_router,compile, 
           [[{'_', 
            [{"/action",action_handler,[]}, 
            {"/join",hello_handler,[]}]}]], 
           []}, 
          {cowboy_ninja_app,start,2, 
           [{file,"src/cowboy_ninja_app.erl"},{line,8}]}, 
          {application_master,start_it_old,4, 
           [{file,"application_master.erl"}, 
           {line,273}]}]}}}} 
    type: permanent 
{"Kernel pid terminated",application_controller,"{application_start_failure,cowboy_ninja,{bad_return,{{cowboy_ninja_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_',[{\"/action\",action_handler,[]},{\"/join\",hello_handler,[]}]}]],[]},{cowboy_ninja_app,start,2,[{file,\"src/cowboy_ninja_app.erl\"},{line,8}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"} 
Kernel pid terminated (application_controller) ({application_start_failure,cowboy_ninja,{bad_return,{{cowboy_ninja_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_',[{"/action",acti 
heart: Sun Jan 1 17:03:58 2017: Erlang is crashing .. (waiting for crash dump file) 
heart: Sun Jan 1 17:03:58 2017: Would reboot. Terminating. 
gmake: *** [erlang.mk:6448: run] Error 1 

このファイルが見つかりませんか?このエラーメッセージはどういう意味ですか?

答えて

0

ファイルcowboy_ninja.appを作成し、使用しているすべてのアプリケーション(カウボーイなど)を一覧表示する必要があります。 Relxはそのファイルを見て、リリースにどのアプリケーションを含める必要があるのか​​を確認します。

http://learnyousomeerlang.com/building-otp-applications

現在はカウボーイのアプリケーションを含むされていないかのいずれかがあなたのリリースにモジュールをコンパイルしています。ここで

the cowboy examples

{application, 'hello_world', [ 
    {description, "Cowboy Hello World example"}, 
    {vsn, "1"}, 
    {modules, ['hello_world_app','hello_world_sup','toppage_handler']}, 
    {registered, [hello_world_sup]}, 
    {applications, [kernel,stdlib,cowboy]}, 
    {mod, {hello_world_app, []}}, 
    {env, []} 
]}. 

の例であるまた、ここで、(あなたのrelx.configで)アプリケーションを探す場所をrelxを指示する必要があります。

{lib_dirs, [ 
    "/usr/local/lib/elixir/lib/*/ebin", "./_build/prod/lib/*/ebin", "./deps/*/ebin"]}. 

アプリがerlang.mkを見てみるためのビルドツールを使用していない場合。それは自動的にあなたのためのアプリファイルを作成します。

+0

こんにちは、私はまだこの問題があります:https://stackoverflow.com/questions/46492630/kernel-pid-terminated-application-start-failure-bad-return – quantumpotato

関連する問題