我有一个使用此配置的钢筋的简单项目:
{sub_dirs, [
"gen",
"apps/basilisk_server",
"rel"
"apps/*"
"ebin"
"deps/*/ebin"
]}.
{erl_opts, [debug_info, fail_on_warning]}.
{
deps,
[
{ email_address, ".*", { git, "git://github.com/mswimmer/erlang-email-address.git", "master"}},
{ gen_smtp , ".*", { git, "https://github.com/Vagabond/gen_smtp.git" , "master"}},
{ pat , ".*", { git, "https://github.com/selectel/pat.git" , "master"}},
{ thrift , ".*", { git, "https://github.com/MustyMustelidae/ThriftErl.git", "master"}}
]
}.
我的目录结构是:
+---.rebar
+---deps
| +---edown
| | +---.rebar
| | +---bin
| | +---doc
| | +---ebin
| | +---priv
| | | \---scripts
| | +---samples
| | \---src
| +---email_address
| | +---.rebar
| | +---ebin
| | +---src
| | \---test
| +---gen_smtp
| | +---.rebar
| | +---ebin
| | +---src
| | +---test
| | \---testdata
| +---gproc
| | +---.rebar
| | +---doc
| | +---ebin
| | +---include
| | +---patches
| | | +---gen_leader
| | | +---kernel
| | | \---stdlib
| | +---priv
| | +---reference
| | +---src
| | +---test
| | | \---eqc
| | \---tetrapak
| +---lager
| | +---.rebar
| | +---ebin
| | +---include
| | +---src
| | \---test
| +---pat
| | +---.rebar
| | +---ebin
| | +---include
| | \---src
| +---proper
| | +---.rebar
| | +---doc
| | +---ebin
| | +---examples
| | +---include
| | +---src
| | \---test
| +---tempo
| | +---.rebar
| | +---c_src
| | +---doc
| | | \---utf8
| | +---ebin
| | +---src
| | \---test
| \---thrift
| +---.rebar
| +---ebin
| +---include
| +---out
| | \---production
| | \---erl
| +---src
| \---test
+---ebin <--- My .app/.beam
\---src <--- My source files
\---gen <---More source files
(对不起,墙)
每个依赖项都有一个.app文件在其ebin文件夹中,我正在运行命令erl -pa apps/*/ebin -pa ebin -pa deps/*/ebin
。我希望我能够运行application:ensure_all_started(somedep).
其中&#34; somedep&#34;是在其ebin文件夹中定义了.app的依赖项的名称。但当我为其中任何一个运行它时,我得到错误{error,{somedep,{"no such file or directory","somedep.app"}}}
。当我为自己的应用程序运行它时,我得到了正确的响应({ok,_})。因为我不能开始依赖&#39;应用程序,我自己的应用程序失败,出现undef
错误。我错过了一些在shell上注册.app文件的步骤吗?
答案 0 :(得分:3)
Windows命令shell不会展开apps/*/ebin
和deps/*/ebin
中的通配符,因此未正确设置Erlang加载路径。