代码之家  ›  专栏  ›  技术社区  ›  Selali Adobor

为什么我的Erlangshell不加载钢筋依赖项?

  •  1
  • Selali Adobor  · 技术社区  · 11 年前

    我有一个使用钢筋的简单项目,配置如下:

      {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
    

    (对不起,这堵墙) 每个依赖项在其ebin文件夹中都有一个.app文件,我正在运行该命令 erl -pa apps/*/ebin -pa ebin -pa deps/*/ebin 我想我应该能跑了 application:ensure_all_started(somedep). 其中“somedep”是在其ebin文件夹中定义了.app的依赖项的名称。但当我为他们中的任何一个运行它时,我都会出错 {error,{somedep,{"no such file or directory","somedep.app"}}} 。当我为自己的应用程序运行它时,我得到了正确的响应({ok,_})。因为我无法启动依赖项的应用程序,所以我自己的应用程序失败 undef 错误我是否错过了在shell中注册.app文件的步骤?

    1 回复  |  直到 11 年前
        1
  •  3
  •   Steve Vinoski    11 年前

    Windows命令shell不会扩展中的通配符 apps/*/ebin deps/*/ebin ,因此Erlang加载路径设置不正确。