我有简单的功能:
do_stuff(_Whatever) ->
jiffy:decode(<<"{\"foo\": \"bar\"}">>).
如您所见,它取决于库 jiffy。所以我将它添加到rebar.config
:
{deps, [
{cowboy, {git, "https://github.com/ninenines/cowboy", {tag, "2.0.0-pre.1"}}},
{jiffy, {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}
]}.
{relx, [{release, { myapp, "0.1.0" },
[vizcerl,
sasl
]},
%{sys_config, "./config/sys.config"},
%{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]
}.
但是,当我运行rebar3 run
程序并执行该操作时,我会收到该函数未定义的错误。
编辑:我跑来rebar3 tree
检查 dep 是否被识别,结果如下:
└─ myapp─0.1.0 (project app)
├─ cowboy─2.0.0-pre.1 (git repo)
│ ├─ cowlib─1.0.0 (git repo)
│ └─ ranch─1.0.0 (git repo)
└─ jiffy─0.14.8 (git repo)