2
votes

I am having a similar problem as here for running an rebar app

Basically, I want to run the demo code from: https://github.com/hukl/fancyapi

When I am in the root directory, and I do:

→ erl [...] -pa ebin -pa deps/*/ebin
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]

Eshell V5.9.2  (abort with ^G)
1> application
1> .
application
2> application:start(fancyapi).
{error,{"no such file or directory","fancyapi.app"}}
3> application:start("fancyapi").
{error,{bad_application,"fancyapi"}}
4> 

How would ERL find the fancyapi code?

1
Works for me. Did you run rebar compile? And did it produce a fancyapi.app file in the ebin directory?legoscia
yes, that was my problem.poseid

1 Answers

3
votes
[g@dev1 ~/work]$ git clone git://github.com/hukl/fancyapi.git
Cloning into 'fancyapi'...
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 12 (delta 0), reused 12 (delta 0)
Receiving objects: 100% (12/12), done.

[g@dev1 ~/work]$ cd fancyapi/

[g@dev1 ~/work/fancyapi]$ rebar get-deps
==> fancyapi (get-deps)
Pulling etest from {git,"git://github.com/wooga/etest.git"}
Cloning into 'etest'...
Pulling etest_http from {git,"git://github.com/wooga/etest_http.git"}
Cloning into 'etest_http'...
Pulling elli from {git,"git://github.com/knutin/elli.git"}
Cloning into 'elli'...
==> etest (get-deps)
==> etest_http (get-deps)
Pulling jiffy from {git,"git://github.com/davisp/jiffy.git","HEAD"}
Cloning into 'jiffy'...
==> jiffy (get-deps)
==> elli (get-deps)

[g@dev1 ~/work/fancyapi]$ rebar compile
==> etest (compile)
Compiled src/etest_runner.erl
==> jiffy (compile)
Compiled test/jiffy_tests.erl
Compiled test/util.erl
Compiled src/jiffy_utf8.erl
Compiled src/jiffy.erl
Compiled test/etap.erl
Compiling c_src/decoder.c
Compiling c_src/encoder.c
Compiling c_src/jiffy.c
Compiling c_src/utf8.c
Compiling c_src/util.c
==> etest_http (compile)
Compiled src/etest_http.erl
Compiled src/etest_http_json.erl
Compiled test/etest_http_test.erl
==> elli (compile)
Compiled src/elli_handler.erl
Compiled src/elli_middleware_compress.erl
Compiled src/elli_example_middleware.erl
Compiled src/elli_middleware.erl
Compiled src/elli_util.erl
Compiled src/elli_request.erl
Compiled src/elli.erl
Compiled src/elli_test.erl
Compiled src/elli_example_callback.erl
Compiled src/elli_http.erl
==> fancyapi (compile)
Compiled src/fancyapi_app.erl
Compiled src/fancyapi_callback.erl
Compiled src/fancyapi_sup.erl
Compiled test/my_fancy_test.erl

[g@dev1 ~/work/fancyapi]$ erl -pa ebin -pa ebin deps/*/ebin
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.3.1  (abort with ^G)
1> application:start(fancyapi).
ok