rebar.config的依赖包名称问题
发布时间:2020-12-13 21:58:09 所属栏目:百科 来源:网络整理
导读:问题出在rebar,rebar3没测试。 今天用rebar管理项目,在添加一个类库时遇到问题,类库地址为: https://github.com/tonyg/erlang-rfc4627 rebar.config里面这么写: {deps,[{erlang-rfc4627,".*",{git,"git://github.com/tonyg/erlang-rfc4627.git","master
问题出在rebar,rebar3没测试。 今天用rebar管理项目,在添加一个类库时遇到问题,类库地址为: https://github.com/tonyg/erlang-rfc4627 rebar.config里面这么写: {deps,[ {erlang-rfc4627,".*",{git,"git://github.com/tonyg/erlang-rfc4627.git","master"}},]}. 这样写不行,查了很久,才发现问题出在erlang-rfc4627这个字段。 使用erlang读取文件: $erl 1>file:consult("rebar.config"). {error,{5,erl_parse,"badterm"}} 原因很可能是,erlang中的原子不以-符号连接,erlang-rfc4627可以改名为erlang_rfc4627,或者'erlang-rfc4627'。 改为erlang_rfc4627继续。 获取所有依赖还是失败,失败原因: {name_mismatch,... {expected,erlang_rfc4627},{has,rfc4627_jsonrpc}}}. 参考:Respository Name and application name conflicts 这是因为ebin/rfc4627_jsonrpc.app写着: {application,rfc4627_jsonrpc,...}. 而rebar下载的目录名称为erlang_rfc4627, 跟rfc4627_jsonrpc不匹配。 最后改为: {deps,[ {rfc4627_jsonrpc,"master"}} ]}. 名称改为app中的项目名称即可。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |