我正在使用 rebar 来获取/编译我的依赖项,其中包含以下内容rebar.conf
:
{deps, [
...
{couchbeam, ".*", {git, "git://github.com/benoitc/couchbeam.git", {branch, "master"}}}
]}.
然后我使用 relx 生成版本。relx.config 有:
{release, {myapp, "0.0.1"}, [myapp, couchbeam]}.
{extended_start_script, true}.
myapp.app.src:
{application, myapp,
[
{description, ""},
{vsn, "1"},
{registered, []},
{applications, [
kernel,
stdlib,
... ,
couchbeam
]},
{mod, { myapp_app, []}},
{env, []}
]}.
启动 couchdb 后,我在控制台下运行我的版本并尝试使用以下几行测试 couchbeam:
Host = "localhost",
Port = 5984,
Prefix = "",
Options = [],
S = couchbeam:server_connection(Host, Port, Prefix, Options).
{ok, _Version} = couchbeam:server_info(S).
最后一行给了我错误:
** exception error: undefined function jsx:decode/1
为了解决这个问题,我打开deps/couchbeam/couchbeam.app.src
并更改了:
{applications, [kernel,
stdlib,
asn1,
crypto,
public_key,
ssl,
idna,
hackney
]},
并添加了 jsx:
{applications, [kernel,
stdlib,
asn1,
crypto,
public_key,
ssl,
idna,
hackney,
jsx
]},
我如何将 couchbeam 添加为依赖项的设置有问题吗?我觉得我不应该破解我的依赖项之一的 .app.src