简体   繁体   中英

Why doesn't my Erlang shell load rebar dependencies?

I have a simple project using rebar with this config:

  {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"}}
    ]
  }.

My directory structure is:

            +---.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

(Sorry for the wall) Each of the dependencies has a .app file in it's ebin folder, and I'm running the command erl -pa apps/*/ebin -pa ebin -pa deps/*/ebin . I expect I should be able to run application:ensure_all_started(somedep). where "somedep" is the name of a dependency with a .app defined in it's ebin folder. But when I run it for any of them I get the error {error,{somedep,{"no such file or directory","somedep.app"}}} . When I run it for my own application I get the correct response ({ok,_}). Because I can't start the dependencies' applications, my own application fails with an undef error. Am I missing some step to register my .app files with the shell?

Windows命令外壳程序不会在apps/*/ebindeps/*/ebin扩展通配符,因此未正确设置Erlang加载路径。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM