Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble running the example in ex3-drop-app #2

Open
bmitch opened this issue Feb 24, 2018 · 1 comment
Open

Trouble running the example in ex3-drop-app #2

bmitch opened this issue Feb 24, 2018 · 1 comment

Comments

@bmitch
Copy link

bmitch commented Feb 24, 2018

Going through the book and was trying this example in chapter 11.

I cloned this repo, navigated to the ch11/ex3-drop-app folder and ran the following:

Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.2  (abort with ^G)
1> c(drop_app).
{ok,drop_app}
2> code:add_path("ebin/").
true
3> application:load(drop).
ok
4> application:start(drop).
{error,{bad_return,{{drop_app,start,[normal,[]]},
                    {'EXIT',{undef,[{drop_sup,start_link,[],[]},
                                    {application_master,start_it_old,4,
                                                        [{file,"application_master.erl"},{line,273}]}]}}}}}
5> 
=INFO REPORT==== 24-Feb-2018::11:08:42 ===
    application: drop
    exited: {bad_return,
                {{drop_app,start,[normal,[]]},
                 {'EXIT',
                     {undef,
                         [{drop_sup,start_link,[],[]},
                          {application_master,start_it_old,4,
                              [{file,"application_master.erl"},
                               {line,273}]}]}}}}
    type: temporary

Not sure what I am missing? Thanks.

@rustkas
Copy link

rustkas commented Nov 17, 2019

After c(drop_app). you also have to compile drop_sup and drop_app modules too ( c(drop_sup). c(drop_app). ).
After that application will be started correctly.

7> application:start(drop).
ok
8> gen_server:call(drop, 60).
{ok,34.292856398964496}
9> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants