1

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?

Selali Adobor
  • 2,060
  • 18
  • 30
  • What operating system are you on? – mbesso Jul 26 '14 at 08:30
  • when you execute `application:ensure_all_started(your_application)` does it return `{ok,[email_address, crypto, asn1, public_key, ssl, gen_smtp, gproc, pat, thrift]}`? – Pascal Jul 26 '14 at 08:43
  • I'm on windows, and when I execute `application:ensure_all_started(my_application)`. I get `{ok,[my_application]}` (none of the dependencies show up). I've noticed if I add `-pa deps/some_dep/ebin` (some_dep is any one of those dependencies) `application:ensure_all_started(some_dep)`,works, so it seems the wildcard isn't being respected. – Selali Adobor Jul 26 '14 at 20:02

1 Answers1

3

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.

Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46