<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="Cambria"><br>
i'm building a web backend using cowboy and mnesia.<br>
at this point i'm running mnesia on only one node and don't need
distributed mnesia for the foreseeable future.<br>
<br>
i installed cowboy and bootstrapped my cowboy app per the
instructions in the cowboy user guide on ninenines.eu.<br>
i run my cowboy app with "make run" which uses the rather involved
"erlang.mk" makefile in the ninenines repo.<br>
<br>
i need to specify that my cowboy app is dependent on the mnesia
app.<br>
i edited "Makefile" in my app's root directory and added "mnesia"
to the DEPS variable.<br>
when i then execute "make run" i get "Error: Unknown or invalid
dependency: mnesia."<br>
<br>
when i execute "make run", erlang.mk appears to automatically
construct ebin/<my_app>.app - no doubt using some other
input which i haven't found yet.<br>
if i manually edit ebin/<my_app>.app to add mnesia to the
"applications" tuple then mnesia runs as expected.<br>
<br>
how do i specify that my cowboy app is dependent on mnesia such
that the </font><font face="Cambria"><font face="Cambria"><my_app></font>.app
config file gets constructed correctly every time i execute "make
run"?<br>
<br>
but wait, there's more... :(<br>
<br>
i constructed an mnesia schema in a particular directory under the
cowboy app directory hierarchy.<br>
i need to specify this directory to mnesia which apparently can
only be done using the "-mnesia dir <Dir>" option to erl.<br>
<br>
is there any other way to do this?<br>
why isn't the schema directory an argument to mnesia:start()?<br>
that seems much more intuitive.<br>
<br>
back again to the gigantic erlang.mk where i found where the erl
command that runs erts which in turn runs my cowboy app.<br>
i added the "-mnesia dir <Dir>" option to the erl command
line, but mnesia is still not finding my pre-defined schema - it's
running in ram-only mode which means it didn't find a pre-defined
schema.<br>
<br>
i can run erl manually in the directory above the directory where
my pre-defined schema is located, and see that the schema is there
and it's configured as i expected.<br>
<br>
when executing "make run" (navigating through the erlang.mk maze),
how do i get mnesia to see the schema directory when it's launched
by the cowboy app?<br>
do i need to pass an argument to some start() function?<br>
does erlang.mk need to be modified or one of its inputs modified?<br>
<br>
thanx for any assistance!<br>
<br>
</font>
</body>
</html>