我的目标是获取所有依赖项并在我的本地计算机上运行riak_ensemble。但是,当我运行rebar get-deps时,我总是遇到:
Cloning into 'neotoma'... ERROR: Dependency dir /home/project/riak/riak_ensemble_demo/deps/cuttlefish/deps/neotoma failed application validation with reason: {version_mismatch,{"/home/agung/project/riak/riak_ensemble_demo/deps/cuttlefish/deps/neotoma/src/neotoma.app.src",
{expected,"1.7.3"},
{has,"1.7.2-9-g2f2b8e6"}}}.
该错误指向了neotoma的一个版本。问题是neotoma在其存储库中有该版本。这是存储库的屏幕截图:
这是我的乌贼的rebar.config文件
{require_otp_vsn, "R16|17|18"}.
{erl_opts, [warnings_as_errors, {parse_transform, lager_transform}, debug_info, warn_untyped_record]}.
{eunit_opts, [verbose]}.
{cover_enabled, true}.
{escript_emu_args, "%%! -escript main cuttlefish_escript -smp disable +A 0\n"}.
{escript_incl_apps, [goldrush, getopt, lager]}.
{xref_checks, []}.
{xref_queries, [{"(XC - UC) || (XU - X - B - \"(rebar.*|mustache)\" : Mod)", []}]}.
{deps, [
{getopt, ".*", {git, "git://github.com/jcomellas/getopt.git", {tag, "v0.8.2"}}},
{lager, "(2.0|2.1|2.2).*", {git, "git://github.com/basho/lager.git", {tag, "2.2.0"}}},
{neotoma, "1.7.3", {git, "git://github.com/seancribbs/neotoma.git", {tag, "1.7.3"}}}
]}.
{post_hooks, [
{"-win32", compile, "rebar escriptize"},
{"^((?!-win32).)*$", compile, "./rebar escriptize"}
]}.
[增订] 这是riak_ensemble_demo的rebar.config
{erl_opts, [debug_info,
warnings_as_errors,
{parse_transform, lager_transform}]}.
{deps, [{lager, "2.0.3", {git, "git://github.com/basho/lager.git", {tag, "2.0.3"}}},
{riak_ensemble, ".*", {git, "git://github.com/basho/riak_ensemble", {branch,"develop"}}}]}.
我运行rebar get-deps
来实现所需的所有依赖项。
我如何实现这种依赖?谢谢!
答案 0 :(得分:1)
所以基本上每个项目都有自己的rebar.config
文件,它指定自己的依赖项。在这种情况下,看起来一个应用程序需要不同版本的neotoma
。处理这类问题的最简单方法是" fork" (Github功能)您的帐户的存储库和更正依赖项是必需的。然后,您将更新您的应用程序,以从您的存储库副本而不是所有者的副本中请求该应用程序。解决问题后,您可以向原始存储库的所有者发送拉取请求(另一个Github功能),以便他们可以将更改合并到其代码中。
你可能不想" fork"所有存储库,只是那些解决此问题所需的存储库。转到desp
文件夹并检查所有rebar.config
个文件:
cd ~/myproject/deps
find . -name rebar.config -exec grep -Hw neotoma \{\} \;
这为您提供了需要neotoma
的应用程序列表以及需要它们的版本。这些应用可能需要"分叉"并纠正。