我目前正在使用Cowboy作为Web服务器框架在Erlang中开发服务器。在启动时,我需要能够进行服务器端HTTP调用以从其他Web服务器获取文件,因此我已将Makefile依赖项包含到ibrowse
ibrowse文档没有提到任何具体关于被添加为Cowboy依赖项的内容,但是erlang.mk文档表明我只需要添加单行
DEPS = ibrowse
然而,只要我添加此行,Cowboy就会在启动时崩溃
=INFO REPORT==== 15-Feb-2018::14:51:13 ===
application: geo_server
exited: {bad_return,
{{geo_server_app,start,[normal,[]]},
{'EXIT',
{undef,
[{cowboy_router,compile,
[[{'_',
[{"/",default_handler,[]},
{"/client_info",client_info_handler,[]},
{"/search",request_handler,[]}]}]],
[]},
{geo_server_app,start,2,
[{file,"src/geo_server_app.erl"},{line,8}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},
{line,273}]}]}}}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,geo_server,{bad_return,{{geo_server_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_',[{\"/\",default_handler,[]},{\"/client_info\",client_info_handler,[]},{\"/search\",request_handler,[]}]}]],[]},{geo_server_app,start,2,[{file,\"src/geo_server_app.erl\"},{line,8}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,geo_server,{bad_return,{{geo_server_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy_router,compile,[[{'_',[{"/",default_handle
heart: Thu Feb 15 14:51:14 2018: Erlang is crashing .. (waiting for crash dump file)
heart: Thu Feb 15 14:51:14 2018: Would reboot. Terminating.
gmake: *** [erlang.mk:6639: run] Error 1
取消这种依赖性,牛仔开始很好。
PROJECT = geo_server
PROJECT_DESCRIPTION = Geographic information server
PROJECT_VERSION = 0.1.0
DEPS = cowboy
dep_cowboy_commit = 2.2.2
DEP_PLUGINS = cowboy
include erlang.mk
DEPS = ibrowse
我是否在行DEPS = ibrowse
之前或之后放置include elrang.mk
并不重要。
经过一些更多的涂鸦后,这似乎是牛仔make run
过程有效的缓存问题。
添加ibrowse似乎需要两次调用make run
。如果我的代码崩溃了,我必须先添加然后再删除ibrowse才能看到修改后的代码运行。
由于
Chris W
答案 0 :(得分:1)
答案 1 :(得分:0)
DEPS只需要出现一次并包含一个空格分隔的依赖项列表