title: My Erlang application don't see ranch module dependency
body: <p>(Newbie here) I am having an error when trying to run <a href="https://github.com/ninenines/ranch/tree/master/examples/tcp_reverse" rel="nofollow">ranch example</a>.
  Via <code>rebar</code> I created application and node (please see on <a href="https://github.com/dima-starosud/ranch-test" rel="nofollow">github</a>).
  But when I am trying to build and run it I am getting <code>undef</code> <code>ranch,start_listener</code>.</p>
  
  <p>Please see full console output:</p>
  
  <pre><code>$ rebar get-deps compile generate &amp;&amp; sh rel/reverse/bin/reverse console
  WARN:  Expected reverse/deps/ranch to be an app dir (containing ebin/*.app), but no .app found.
  ==&gt; rel (get-deps)
  ==&gt; reverse (get-deps)
  WARN:  Expected reverse/deps/ranch to be an app dir (containing ebin/*.app), but no .app found.
  Pulling ranch from {git,"git@github.com:ninenines/ranch.git",{tag,"1.1.0"}}
  Cloning into 'ranch'...
  ==&gt; ranch (get-deps)
  ==&gt; ranch (compile)
  Compiled src/ranch_transport.erl
  Compiled src/ranch_sup.erl
  Compiled src/ranch_ssl.erl
  Compiled src/ranch_tcp.erl
  Compiled src/ranch_protocol.erl
  Compiled src/ranch_listener_sup.erl
  Compiled src/ranch_app.erl
  Compiled src/ranch_acceptors_sup.erl
  Compiled src/ranch_acceptor.erl
  Compiled src/ranch_server.erl
  Compiled src/ranch.erl
  Compiled src/ranch_conns_sup.erl
  ==&gt; rel (compile)
  ==&gt; reverse (compile)
  Compiled src/reverse_sup.erl
  Compiled src/reverse_app.erl
  Compiled src/reverse_protocol.erl
  ==&gt; rel (generate)
  WARN:  'generate' command does not apply to directory reverse
  Exec: reverse/rel/reverse/erts-6.3/bin/erlexec  -boot reverse/rel/reverse/releases/1/reverse -mode embedded -config reverse/rel/reverse/releases/1/sys.config -args_file reverse/rel/reverse/releases/1/vm.args -- console
  Root: reverse/rel/reverse
  Erlang/OTP 17 [erts-6.3] [source-f9282c6] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
  
  Eshell V6.3  (abort with ^G)
  (reverse@127.0.0.1)1&gt; 
  =INFO REPORT==== 30-Dec-2014::22:47:08 ===
      application: reverse
      exited: {bad_return,
                  {{reverse_app,start,[normal,[]]},
                   {'EXIT',
                       {undef,
                           [{ranch,start_listener,
                                [reverse,10,ranch_tcp,
                                 [{port,5555}],
                                 reverse_protocol,[]],
                                []},
                            {reverse_app,start,2,
                                [{file,"src/reverse_app.erl"},{line,13}]},
                            {application_master,start_it_old,4,
                                [{file,"application_master.erl"},
                                 {line,272}]}]}}}}
      type: permanent
  {"Kernel pid terminated",application_controller,"{application_start_failure,reverse,{bad_return,{{reverse_app,start,[normal,[]]},{'EXIT',{undef,[{ranch,start_listener,[reverse,10,ranch_tcp,[{port,5555}],reverse_protocol,[]],[]},{reverse_app,start,2,[{file,\"src/reverse_app.erl\"},{line,13}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,272}]}]}}}}}"}
  
  Crash dump was written to: erl_crash.dump
  </code></pre>
  
  <p>I am not sure I correctly added <code>ranch</code> to <code>reltool.config</code> (<a href="https://github.com/dima-starosud/ranch-test/blob/master/rel/reltool.config#L27" rel="nofollow">please see on github</a>). But If I remove <code>deps</code> from <code>libs_dir</code> path I will get <code>rebar generate</code> error <code>Application version clash. Multiple directories contain version ...</code>.</p>
  
  <p><strong>UPDATE</strong> if I remove <a href="https://github.com/dima-starosud/ranch-test/blob/master/src/reverse_app.erl#L13" rel="nofollow">failing call</a> and run it, <code>application:which_applications().</code> gives me <code>{ranch,[],[]}</code> as one of the running ones.</p>
  
  <p><strong>UPDATE</strong> versions</p>
  
  <pre><code>$ erl
  Erlang/OTP 17 [erts-6.3] [source-f9282c6] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
  
  $ rebar --version
  rebar 2.5.1 17 20141223_141030 git 2.5.1-84-gdd9125e
  </code></pre>
  
  <p>What I am doing wrong?</p>
  
  <p>Thanks in advance!</p>