带有rabbitMQ的Mongooseim:mochijson2可能包括两个不同的应用程序

时间:2015-04-24 18:59:06

标签: erlang rabbitmq rebar mongoose-im

我正在尝试使用rabbitMQ构建mongooseim。我在做make rel时得到以下错误。

==> rel (generate)
ERROR: generate failed while processing /home/mongoose/MongooseIM/rel: {'EXIT',{{badmatch,{error,"Module mochijson2 potentially included by two different applications: mochijson2 and rabbit_common."}},
         [{rebar_reltool,generate,2,[]},
          {rebar_core,run_modules,4,[]},
          {rebar_core,execute,5,[]},
          {rebar_core,process_dir1,6,[]},
          {rebar_core,process_each,5,[]},
          {rebar_core,process_dir1,6,[]},
          {rebar_core,process_commands,2,[]},
          {rebar,main,1,[]}]}}
make: *** [rel] Error 1

解决此问题的最佳方法是什么?我没有从谷歌获得太多信息。我的钢筋配置文件如下:

{ok, Path} = file:get_cwd(),
ConfigureOut = Path ++ "/../configure.out",
Conf = case file:consult(ConfigureOut) of
            {ok, Terms} -> Terms;
            E -> io:format("WARN: error ~p reading file: ~p - using default rel config~n", [E, ConfigureOut]), []
       end,

BaseAppsToRun = [compiler,
                 lager,
                 kernel,
                 mnesia,
                 sasl,
                 ssl,
                 stdlib,
                 ejabberd,
                 inets,
                 syntax_tools,
                 p1_stringprep,
                 exml,
                 cowboy,
                 fusco,
                 folsom,
                 exometer,
                 xmerl,
                 amqp_client,
                 rabbit_common],

AppsToRunIn = BaseAppsToRun ++ proplists:get_value(apps_to_run, Conf, []),

AppsToRun = ordsets:to_list(ordsets:from_list(AppsToRunIn)),

BaseAppsToInclude = AppsToRun ++
                    [asn1,
                     crypto,
                     public_key,
                     goldrush,
                     runtime_tools,
                     p1_utils,
                     ranch,
                     cowlib,
                     bear,
                     mochijson2,
                     p1_cache_tab,
                     pa,
                     base16,
                     cuesport,
                     alarms,
                     idna,
                     recon,
                     setup,
                     xmerl,
                     amqp_client,
                     rabbit_common],


RemovedApps = [mysql,pgsql,redo,seestar,odbc],

AppsToIncludeIn = BaseAppsToInclude ++ proplists:get_value(apps_to_include, Conf, []),

AppsToInclude = ordsets:to_list(ordsets:from_list(AppsToIncludeIn)),

IncludeApps = lists:map(fun(App) -> {app, App, [{incl_cond, include}]} end, AppsToInclude),


[{sys, [
        {lib_dirs, ["../apps", "../deps"]},
        {incl_cond, exclude},
        {rel, "mongooseim", "", [mongoose | AppsToRun]},
        {rel, "start_clean", "", [kernel,stdlib]},
        {boot_rel, "mongooseim"},
        {profile, embedded},
        {excl_archive_filters, [".*"]}, % do no archive built libs
        {excl_sys_filters, ["^bin/.*",
                            "^erts.*/bin/(dialyzer|typer)"]},

        {app, mongoose, [{incl_cond, include}, {lib_dir, ".."}]}
       ] ++ IncludeApps},


{target_dir, "mongooseim"},

{overlay_vars, "vars.config"},

{overlay, [{mkdir, "log/sasl"},
               {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
               {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
           {copy, "files/mongooseim", "bin/mongooseim"},
           {copy, "files/mongooseimctl", "bin/mongooseimctl"},
           {copy, "files/app.config", "etc/app.config"},
           {template, "files/vm.args", "etc/vm.args"},
           {template, "files/ejabberd.cfg", "etc/ejabberd.cfg"},
           {mkdir, "var"},
           {mkdir, "var/log"}
          ]}
].

1 个答案:

答案 0 :(得分:1)

我之前遇到过同样的问题。有几种方法可以解决这个问题。

  1. 使用rabbitmq common的旧版本。 common's 2.8.2版本不包含mochijson2模块。

  2. 在" reltool.config"文件,尝试为rabbitmq common或mochiweb排除mochijson2。 (需要仔细阅读与发布相关的文档)。