I aim to get all dependencies and run riak_ensemble on my local machine. However, When I run rebar get-deps, I always encounter:
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"}}}.
The error is pointing a version of neotoma. The thing is that neotoma has that version on its repository. Here's the screenshoot of the repository:
here's my rebar.config file for cuttlefish
{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"}
]}.
[UPDATED] This is my rebar.config for riak_ensemble_demo
{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"}}}]}.
And I run rebar get-deps
to fulfill all the dependencies that needed.
How do I fulfill this dependency? Thanks!
So basically each project has it's own rebar.config
file where it specifies its own dependencies. In this case looks like one application requires a different version of neotoma
than the other. The simplest way of dealing with issues like these is to "fork" (Github feature) the repositories to your account and correct the dependencies are required. Then you would update your application to require the application from your copy of the repository rather than the owner's one. Once you fix the issue you can send a pull-request (another Github feature) to the owner of the original repository so that they can incorporate your changes to their code.
You probably don't want to "fork" all repositories, just those required to fix this issue. Go to the desp
folder and check all rebar.config
files:
cd ~/myproject/deps
find . -name rebar.config -exec grep -Hw neotoma \{\} \;
This gives you a list of applications that require neotoma
and versions in which they are required. Those application probably will need to be "forked" and corrected.