Have you compiled the code?
--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nitrogenweb...@googlegroups.com.
To post to this group, send email to nitro...@googlegroups.com.
Visit this group at http://groups.google.com/group/nitrogenweb.
For more options, visit https://groups.google.com/d/optout.
Hi Roelof,
Yes, there may be a slight ambiguity in the text. No doubt there are many more. But with help of readers like you we'll dig 'em out.
As noted in Erlang erl docs, erl -pa ebin simply puts the ebin directory in the code path so it can be found when you compile the system:
-pa Dir1 Dir2 ...
Adds the specified directories to the beginning of the code path, similar to code:add_pathsa/1. See code(3). As an alternative to -pa, if several directories are to be prepended to the code and the directories have a common parent directory, that parent directory could be specified in the ERL_LIBS environment variable. See code(3).
http://erlang.org/doc/man/erl.html
In other words, -pa Dir... does not open a new directory. If you look more carefully at the commands at the bottom of page 45, you'll see:
~/nb/site/include$ cd ../site
~/nb/site/$ erl -pa ebin
This sequence moved you from the include directory to the site directory. The erl -pa ebin simply puts ebin in the code path. Thus, if you follow the sequence you're executing rr(visitors_db) out of the site directory, in which case rr(visitors_db) should return as expected.
Many thanks for reading our book. We're working hard to post more content soon.
All the best,
Lloyd
Hi Roelof,
Your directory structure should look like this;
nb
...site
......ebin
......include
......src
......static
......templates
Assuming you have the correct directory structure and you are in the nb/site/include directory...
nb/site/include$ cd ../site
... should bring you up one level in the directory hierarchy, e.g. to nb/site.
Also note: it's...
nb/site$ erl -pa ebin % NOTE ebin not erl
Best wishes,