jadahl / mod_restful

RESTful interface to ejabberd
84 stars 34 forks source link

Installation issue on ejabberd 17.04 #35

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi, I am unable to install mod_restful on ejabberd 17.04. It shows following stack trace while installing plugin:

opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:48: can't find include file "include/mod_restful.hrl"
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:63: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:64: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:65: variable 'Options' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:70: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:73: variable 'HTTPRequest' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:73: record request undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:79: variable 'ReqHost' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:101: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:102: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:108: variable 'Q' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:109: variable 'GlobalOpts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:109: variable 'Opts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:110: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:115: variable 'Format' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:120: variable 'GlobalOpts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:120: variable 'Opts' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:123: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:129: variable 'Struct' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:141: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:144: variable 'Q' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:158: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:159: variable 'Data' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl:189: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful.erl:30: Warning: undefined callback function depends/2 (behaviour 'gen_mod')
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful.erl:30: Warning: undefined callback function mod_opt_type/1 (behaviour 'gen_mod')
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:67: can't find include file "include/mod_restful.hrl"
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:69: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:70: variable 'Path' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:104: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:105: variable 'Data' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:127: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:128: variable 'Options' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:175: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:176: record rest_resp undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:177: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:63: Warning: behaviour gen_restful_api undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:175: Warning: variable 'Res' is unused
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:175: Warning: variable 'ResF' is unused
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_admin.erl:181: Warning: function format_result_json/2 is unused
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:36: can't find include file "include/mod_restful.hrl"
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:46: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:47: variable 'Path' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:59: record rest_req undefined
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:60: variable 'Path' is unbound
/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/mod_restful_register.erl:32: Warning: behaviour gen_restful_api undefined
Error: {compilation_failed,"/opt/ejabberd-17.04/.ejabberd-modules/sources/mod_restful/src/gen_restful_api.erl"}

If i look into the directory the hrl file was there but its not in src its in include directory that is outside src directory with proper ejabberd user and group permissions.

Can you tell me what's wrong here?

a1993k commented 7 years ago

To resolve this issue perform following steps 1) search text "include/mod_restful.hrl" in "mod_restful/src" directory (you can use any editor to do folder search. I used notepad++ 2) replace above text with "../include/mod_restful.hrl" in all places

that's it. now you can install plugin