The problem here is that Erlang can't find the LFE ebin directory. Two ways to solve this problem are:
Use an explicit -pa <lfe ebin dir>
argument when starting LFE, either in the lfe.bat
script or when you call it. Simple but hard wired.
Use the ERL_LIBS
environment variable. This is described in the code
module documentation, http://erlang.org/doc/man/code.html. If you create an extra Erlang library directory, say c:\projects\erlang
, drop Erlang apps which follow the Erlang application directory structure as LFE does, and point ERL_LIBS
at it then the code server will automatically add ebin directories it finds there to its code path.
This is also described in How do I install LFE on Ubuntu Karmic? but in a UNIX context.
The ERL_LIBS
feature should definitely be better advertised.
EDIT: Replying to @Shantanu Kumar's comment.
I don't have access to a Windows machine so I can't test it properly. The problem seems to be that using lfe_boot
tries to start the port program ttysl
which doesn't seem to work on Windows, at least not when running erl.exe
. Some solutions to try:
Use werl.exe
instead. This may work, but I would do it anyway.
Try starting Erlang in the normal way with werl.exe -pa ebin
(to get the right load path) and manually starting the LFE shell with lfe_shell:server().
Try starting Erlang with werl.exe -pa ebin -noshell -s lfe_shell start
. This will run lfe_shell
as the shell but the ^G
won't be available.
Also while it is nice to use it you don't need to use the LFE shell to run LFE, you can use the normal Erlang shell and just call the LFE functions in the "normal" way. You might become a little schizophrenic with two io formats, but there are no problems. :-)
Hope this helps.