cowboy_tutorial_webchat
cowboy_tutorial_webchat copied to clipboard
Following rebar instructions in section-2 branch results in error
Following section 2 instructions.
RROR: generate failed while processing /Users/quantum/code/cowboy_tutorial_webchat/rel: {'EXIT',{{badmatch,{error,"appmon: Missing application directory."}},
[{rebar_reltool,generate,2,
[{file,"src/rebar_reltool.erl"},{line,53}]},
{rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,493}]},
{rebar_core,execute,6,[{file,"src/rebar_core.erl"},{line,418}]},
{rebar_core,maybe_execute,8,
[{file,"src/rebar_core.erl"},{line,302}]},
{rebar_core,process_dir1,7,[{file,"src/rebar_core.erl"},{line,261}]},
{rebar_core,process_each,5,[{file,"src/rebar_core.erl"},{line,351}]},
{rebar_core,process_dir1,7,[{file,"src/rebar_core.erl"},{line,253}]},
{rebar_core,process_commands,2,
[{file,"src/rebar_core.erl"},{line,93}]}]}}
~/code/cowboy_tutorial_webchat:.
Since this tutorial was written, the appmon application has been removed from Erlang. It can be replaced with observer.
These steps might help:
- Delete the "{app, gs, [{incl_cond, include}]}" and "{app, observer, [{incl_cond, include}]}" lines from reltool.config and add a "{app, observer, [{incl_cond, include}]}" line instead. (So that we use observer instead of appmon.)
- Change the {incl_cond, exclude} line to {incl_cond, derived}, so that the dependencies of observer are automatically calculated.
Nowadays even rebar is being replaced by its newer version (http://www.rebar3.org/).
{sys, [ {lib_dirs, ["../apps", "../deps"]}, {erts, [{mod_cond, derived}, {app_file, strip}]}, {app_file, strip}, {rel, "chat", "1", [ kernel, gs, stdlib, sasl, runtime_tools, crypto, mimetypes, ranch, cowboy, chat ]}, {rel, "start_clean", "", [ kernel, stdlib ]}, {boot_rel, "chat"}, {profile, embedded}, {incl_cond, exclude}, {excl_archive_filters, ["."]}, %% Do not archive built libs {excl_sys_filters, ["^bin/.", "^erts./bin/(dialyzer|typer)", "^erts./(doc|info|include|lib|man|src)"]}, {excl_app_filters, [".gitignore"]}, {app, sasl, [{incl_cond, include}]}, {app, stdlib, [{incl_cond, include}]}, {app, kernel, [{incl_cond, include}]}, {app, gs, [{incl_cond, include}]}, {app, runtime_tools, [{incl_cond, include}]}, {app, crypto, [{incl_cond, include}]}, {app, mimetypes, [{incl_cond, include}]}, {app, ranch, [{incl_cond, include}]}, {app, cowboy, [{incl_cond, include}]}, {app, chat, [{incl_cond, include}]} ]}.
{target_dir, "chat"}.
{overlay, [ {mkdir, "log/sasl"}, {copy, "files/erl", "{{erts_vsn}}/bin/erl"}, {copy, "files/nodetool", "{{erts_vsn}}/bin/nodetool"}, {copy, "files/chat", "bin/chat"}, {copy, "files/chat.cmd", "bin/chat.cmd"}, {copy, "files/start_erl.cmd", "bin/start_erl.cmd"}, {copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"}, {copy, "files/sys.config", "releases/{{rel_vsn}}/sys.config"}, {copy, "files/vm.args", "releases/{{rel_vsn}}/vm.args"} ]}.