如何将Webmachine集成到Erlang应用程序中?

Llo*_*ice 2 erlang webmachine rebar

我阅读并重新阅读了文档和教程,但是我对如何创建Erlang应用程序和Rebar的理解仍然有足够的洞来像瑞士奶酪.非常简单的东西会让我失望.

我正在努力开发一个Erlang版本,最终将包括我自己的几个应用程序以及Webmachine,也许还有一个或者另一个版本的nosql db.使用Rebar我已经成功编译并测试了我的应用程序:ZZZ和ZZZ_Lib.我的目录结构如下所示.我不相信它是最佳的,但它确实有效.

我已经在... learn1/apps目录下安装了Webmachine.

我的下一步是将Webmachine与名为​​test_resource:erl的下面显示的非常简单的webmachine_demo_resource集成.

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

但是当我尝试编译时,我收到此错误消息:

src/test_resource.erl:3:找不到包含lib"webmachine/include/webmachine.hrl"

这是test_resource.erl中的违规行:

-include_lib("webmachine/include/webmachine.hrl").
Run Code Online (Sandbox Code Playgroud)

我试图设置ERL_LIBS(我不完全理解)和PATH都没有成功.所以,显然,我不明白如何设置正确的路径或如何最好地集成Webmachine.

欢迎任何和所有指导.

LRP

*目录结构

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"
    ]
}.
Run Code Online (Sandbox Code Playgroud)

* zzz_lib.app.src

{application, zzz_lib,
  [
  {description, ""},
  {vsn, "1"},
  {modules, [
      yada yada 
]},
{applications, [
              kernel,
              stdlib,
              webmachine
             ]},
{mod, { zzz_lib_app, []}},
{env, []}
]}.
Run Code Online (Sandbox Code Playgroud)

Jus*_*ehy 5

你最有可能会更喜欢将它包括在一个依赖项中,而不是作为一个包含的应用程序.请参阅Riak Core如何做到这一点:https://github.com/basho/riak_core/blob/master/rebar.config

要获得更多信息,您可能会发现要求邮件列表是值得的:

http://lists.therestfulway.com/mailman/listinfo/webmachine_lists.therestfulway.com

http://lists.basho.com/mailman/listinfo/rebar_lists.basho.com