Erlang 编译错误 "No command to run specified!"
Erlang compile error "No command to run specified!"
我用IntelliJ和Rebar搭建了Erlang开发环境
我修改了Erlang插件提供的模板代码
但是编译不了。
编译日志:
"C: \ Program Files \ erl8.2 \ bin \ rebar" "C: \ Program Files \
No command to run specified!
Usage: rebar [-h] [-c] [-v <verbose>] [-q <quiet>] [-V] [-f]
To see a list of built-in commands, execute rebar -c.
[-D <defines>] [-j <jobs>] [-C <config>] [-p] [-k]
Type 'rebar help <CMD1> <CMD2>' for help on specific commands.
rebar allows you to abbreviate the command to run:
(commands...)
erlang_app.erl
:
-spec(start(StartType :: normal | {takeover, node()} | {failover, node()},
StartArgs :: term()) ->
{ok, pid()} |
{ok, pid(), State :: term()} |
{error, Reason :: term()}).
start(_StartType, _StartArgs) ->
case 'erlang_sup:':start_link() of
{ok, Pid} ->
io:format("start ok~n"),
{ok, Pid};
Error ->
Error
end.
erlang_sub.erl
暂时没有生成通用服务器,所以我也注释掉了函数return.
的AChild
部分和AChlid
部分
%% AChild = {'AName', {'AModule', start_link, []},
%% Restart, Shutdown, Type, ['AModule']},
{ok, {SupFlags, [AChild]}}.
start.bat
werl -pa ./ebin -eval "application:start(erlang)"
您显示的日志表明您有 运行 不带参数的命令 rebar。要编译您的项目,您应该使用 rebar compile
命令。
我用IntelliJ和Rebar搭建了Erlang开发环境
我修改了Erlang插件提供的模板代码
但是编译不了。
编译日志:
"C: \ Program Files \ erl8.2 \ bin \ rebar" "C: \ Program Files \
No command to run specified!
Usage: rebar [-h] [-c] [-v <verbose>] [-q <quiet>] [-V] [-f]
To see a list of built-in commands, execute rebar -c.
[-D <defines>] [-j <jobs>] [-C <config>] [-p] [-k]
Type 'rebar help <CMD1> <CMD2>' for help on specific commands.
rebar allows you to abbreviate the command to run:
(commands...)
erlang_app.erl
:
-spec(start(StartType :: normal | {takeover, node()} | {failover, node()},
StartArgs :: term()) ->
{ok, pid()} |
{ok, pid(), State :: term()} |
{error, Reason :: term()}).
start(_StartType, _StartArgs) ->
case 'erlang_sup:':start_link() of
{ok, Pid} ->
io:format("start ok~n"),
{ok, Pid};
Error ->
Error
end.
erlang_sub.erl
暂时没有生成通用服务器,所以我也注释掉了函数return.
的AChild
部分和AChlid
部分
%% AChild = {'AName', {'AModule', start_link, []},
%% Restart, Shutdown, Type, ['AModule']},
{ok, {SupFlags, [AChild]}}.
start.bat
werl -pa ./ebin -eval "application:start(erlang)"
您显示的日志表明您有 运行 不带参数的命令 rebar。要编译您的项目,您应该使用 rebar compile
命令。