Pergunta

I read and re-read the docs and tutorials, but my understanding of how to create Erlang Applications, and Rebar for that matter, still has enough holes to resemble Swiss cheese. Very simple stuff throws me.

I'm working toward an Erlang Release that will eventually include several applications of my own plus Webmachine and maybe a nosql db of one flavor or another. Using Rebar I've successfully compiled and tested my applications: ZZZ and ZZZ_Lib. my directory structure is shown below. I'm not confident that it's optimal, but it works.

I've installed Webmachine under the ...learn1/apps directory.

My next step has been to integrate Webmachine with the very simple webmachine_demo_resource shown below under the name test_resource:erl.

http://webmachine.basho.com/example_resources.html

But when I try to compile, I get this error message:

src/test_resource.erl:3: can't find include lib "webmachine/include/webmachine.hrl"

Here's the offending line in test_resource.erl:

-include_lib("webmachine/include/webmachine.hrl").

I've tried to set both ERL_LIBS (which I don't fully understand) and PATH with no success. So, clearly, I don't understand how to set the proper path or how best to integrate Webmachine.

Any and all guidance would be gratefully welcomed.

LRP

* Directory structure

learn1$ ls apps rebar rebar.config

learn1/apps$ ls webmachine zzz zzz_lib

learn1/apps/zzz_lib/src$ ls yada yada test_resource.erl yada yada

* rebar.config

{sub_dirs,
    ["apps/zzz",
     "apps/zzz/src",
     "apps/zzz_lib",
     "apps/zzz_lib/src"
    ]
}.

* zzz_lib.app.src

{application, zzz_lib,
  [
  {description, ""},
  {vsn, "1"},
  {modules, [
      yada yada 
]},
{applications, [
              kernel,
              stdlib,
              webmachine
             ]},
{mod, { zzz_lib_app, []}},
{env, []}
]}.

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top