Why doesn't my Erlang shell load rebar dependencies?

1.3k views Asked by At

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?

1

There are 1 answers

0
Steve Vinoski On BEST ANSWER

The Windows command shell doesn't expand the wildcards in apps/*/ebin and deps/*/ebin, so the Erlang load path isn't getting set properly.