首页 文章

为什么我不能运行这个Erlang演示应用程序?

提问于
浏览
1

我有类似的问题here for running an rebar app

基本上,我想运行以下演示代码:https://github.com/hukl/fancyapi

当我在根目录中时,我这样做:

→ 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>

ERL如何找到fancyapi代码?

1 回答

  • 2
    [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
    

相关问题