[erlang-questions] How can I debug this?

Joe Armstrong erlang@REDACTED
Wed Jul 25 10:25:18 CEST 2012


> {"init terminating in
> do_boot",{undef,[{boss,start,[],[],{init,start_it,1,[{file
> ,"init.erl"},[line,1041}]},{init,start_em,1,[{file,"init.erl"},{line,1022}]}]}}

This error message means Erlang cannot find the file boss.beam - some
code has tried to
evaluate the function boss:start() (That's what the cryptic error
message means) and the module
boss is not loaded. When this happens the system tries to find a file
called boss.beam - this must
be one of the files in the code load path.

To debug this - start erlang (If you can't start erlang at all) you're screwed.
then in the erlang shell give the command and code:get_path()
(Or io:format("~p~n",[code:get_path()]).

When I do this I see this:

1 > io:format("~p~n",[code:get_path()]).
[".","/usr/local/lib/erlang/lib/kernel-2.15/ebin",
 "/usr/local/lib/erlang/lib/stdlib-1.18/ebin",
...
"/home/joe/projects/doc42/ebin","/home/joe/projects/validate",
 "/home/joe/nobackup/erlang_imports/deps/meck/ebin",
 "/home/joe/nobackup/erlang_imports/deps/cowboy/ebin",
 "/home/joe/nobackup/erlang_imports/deps/bitcask/ebin"]

One of these directories should contain the file boss.beam

Since boss.beam is not in your path you have to find and add it to your path.
This can be done in (at least) three ways:

If boss.beam is in the directory DIR then you can evaluate this:

> code:add_pathz(Dir).

in the shell

Better is to add it to the erlang startup file.

On a unix or mac you just make a file called ".erlang" which is either
on ${HOME}/.erlang
or the  directory you start erlang from.

I tried to do this on windows but I have no evironment variable HOME
and I do now have write permissions
under Program Files (or whatever)

(( Actually I'd like to keep an up-to-date install guide on the erlang
web site so if anybody
could tell me how to make a .erlang file on windows I would be appreciate this))

Once we know how to make a .erlang file I can fill in the details of
how to get your
boss example running.

Just keep mailing back to this thread every time you have a problem
and we'll get it fixed.

Cheers

/Joe











On Fri, Jul 20, 2012 at 4:05 PM, Ian <hobson42@REDACTED> wrote:
> Hi All,
>
> I am attempting to work through the Chicago Boss quickstart tutorial at
> https://github.com/evanmiller/ChicagoBoss/wiki/Quickstart
>
> I am using Windows 7 - 64 bit, and the R15B release of Erlang.  New to
> Erlang.
>
> First a minor bug - I think I installed the 32 bit version, removed it, and
> installed the 64 bit version.  Then I discovered that the 64 bit  version's
> bin directory is C:\Program Files\erl5.9.1\bin but the directory in the path
> was C:\Program Files (x86)\erl5.9.1\bin. That was why nothing worked.
>
> After that was corrected, I created the project and set up the file in Step
> 4, before starting the server with start-server.bat. The werl window flashed
> up an error message for a second or so - and vanished before I could read
> it!
>
> A few tries later I was able to catch it in a screen dump. The error message
> was:
>

> {"init terminating in
> do_boot",{undef,[{boss,start,[],[],{init,start_it,1,[{file
> ,"init.erl"},[line,1041}]},{init,start_em,1,[{file,"init.erl"},{line,1022}]}]}}
>
> (copied by hand)
>
> I know this means the server did not start up. But why, and what have I done
> wrong/missed out? I have not found a init.erl file.
>
> My project is called erlian and is in d:\erlian . The file
> D:\erlian\src\controller\erlian_greeting_controller.erl
> contains:
>
> -module(erlian_greeting_controller, [Req]).
> -compile(export_all).
>
> hello('GET', []) ->
>     {output, "<strong>Erlian says hello!</strong>"}.
>
> (copy/pasted)
>
> Help much appreciated.
>
> Ian
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list