Erlang: Mnesia can not create schema while release with rebar

笑着哭i 提交于 2019-12-22 10:12:08

问题


When I call mnesia:create_schema on startup, the program crashes. If I run my program in ebin without releasing it, it works find. The error log as follows:

=INFO REPORT==== 3-Jul-2013::09:44:06 ===
application: eddy
exited: {bad_return,
         {{eddy_app,start,[normal,[]]},
          {'EXIT',
           {{badmatch,
             {error,
              {'EXIT',
               {undef,
                [{mnesia_backup,open_write,
                  ["/home/cometeor/eddy/rel/eddy/Mnesia.eddy@127.0.0.1/eddy@127.0.0.1137284464686415846847780"],
                  []},
                 {mnesia_bup,do_apply,4,
                  [{file,"mnesia_bup.erl"},{line,387}]},
                 {mnesia_bup,make_initial_backup,3,
                  [{file,"mnesia_bup.erl"},{line,378}]},
                 {mnesia_bup,create_schema,2,
                  [{file,"mnesia_bup.erl"},{line,348}]},
                 {eddy_database,start,0,
                  [{file,"src/eddy_database.erl"},{line,24}]},
                 {eddy_app,start,2,[{file,"src/eddy_app.erl"},{line,16}]},
                 {application_master,start_it_old,4,
                  [{file,"application_master.erl"},{line,274}]}]}}}},
            [{eddy_database,start,0,
              [{file,"src/eddy_database.erl"},{line,24}]},
             {eddy_app,start,2,[{file,"src/eddy_app.erl"},{line,16}]},
             {application_master,start_it_old,4,
              [{file,"application_master.erl"},{line,274}]}]}}}}

回答1:


Resolved.Must add

{app, mnesia, [{mod_cond, app}]},

to reltool.config.



来源:https://stackoverflow.com/questions/17444760/erlang-mnesia-can-not-create-schema-while-release-with-rebar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!