Hello, I have built mad from source (latest commit 4c8f6043c6fe689851f395b0f2035151982024f1)
and I am trying to experiment with a sample app as instructed:
$ mad app "sample"
$ cd sample/
$ mad deps compile plan bundle "web_app"
But I am getting this:
DTL Compiling /home/takeshi/tmp/learn/mad/sample/apps/n2o_sample/priv/templates/index.html
escript: exception error: undefined function erlydtl_beam_compiler:is_up_to_date/2
in function erlydtl_compiler:parse_template/2 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 378)
in call from erlydtl_compiler:do_compile/1 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 474)
in call from erlydtl_compiler:compile/1 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 206)
in call from lists:foreach/2 (lists.erl, line 1336)
in call from mad_compile:dep/4 (/home/takeshi/src/git/mad/src/mad_compile.erl, line 49)
in call from mad_compile:deps/4 (/home/takeshi/src/git/mad/src/mad_compile.erl, line 11)
I can see this is because erlydtl_beam_compiler.beam is not being generated:
But if i run make inside folder erlydtl, it gets created:
takeshi:sample$ cd deps/erlydtl/
takeshi:erlydtl$ make
... ABRIDGED ...
takeshi:erlydtl$ cd -
/home/takeshi/tmp/learn/mad/sample
takeshi:sample$ find . -name 'erlydtl_beam_compiler.*'
./deps/erlydtl/src/erlydtl_beam_compiler.erl
./deps/erlydtl/ebin/erlydtl_beam_compiler.beam
After that, I can start the app.
But when I access http://localhost:8000
I get this in the erlang repl:
=ERROR REPORT==== 6-Dec-2014::20:48:56 ===
Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.97.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,init,2}},{stacktrace,[{n2o_cowboy,init,[{http_req,#Port<0.16780>,ranch_tcp,keepalive,<0.97.0>,<<"GET">>,'HTTP/1.1',{{127,0,0,1},57061},<<"localhost">>,undefined,8000,<<"/">>,undefined,<<>>,[],[{<<"host">>,<<"localhost:8000">>},{<<"user-agent">>,<<"Mozilla/5.0 (X11; Ubuntu; Linux x8664; rv:34.0) Gecko/20100101 Firefox/34.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.5">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"cookie">>,<<"_ga=GA1.1.1057982470.1417221669; n2o-sid=SZCGG+LCc1OhIFziVocJLQ==">>},{<<"connection">>,<<"keep-alive">>}],[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},[]],[]},{cowboy_handler,execute,2,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_handler.erl"},{line,39}]},{cowboy_protocol,execute,4,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_protocol.erl"},{line,428}]}]},{req,[{socket,#Port<0.16780>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.97.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},57061}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/">>},{path_info,undefined},{qs,<<>>},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">>},{<<"user-agent">>,<<"Mozilla/5.0 (X11; Ubuntu; Linux x8664; rv:34.0) Gecko/20100101 Firefox/34.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.5">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"cookie">>,<<"_ga=GA1.1.1057982470.1417221669; n2o-sid=SZCGG+LCc1OhIFziVocJLQ==">>},{<<"connection">>,<<"keep-alive">>}]},{meta,[]},{body_state,waiting},{buffer,<<>>},{multipart,undefined},{resp_compress,false},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]},{opts,[]}],[{cowboy_protocol,execute,4,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_protocol.erl"},{line,428}]}]}
Hello, I have built mad from source (latest commit 4c8f6043c6fe689851f395b0f2035151982024f1) and I am trying to experiment with a sample app as instructed:
$ mad app "sample" $ cd sample/ $ mad deps compile plan bundle "web_app"
But I am getting this:
DTL Compiling /home/takeshi/tmp/learn/mad/sample/apps/n2o_sample/priv/templates/index.html escript: exception error: undefined function erlydtl_beam_compiler:is_up_to_date/2 in function erlydtl_compiler:parse_template/2 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 378) in call from erlydtl_compiler:do_compile/1 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 474) in call from erlydtl_compiler:compile/1 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 206) in call from lists:foreach/2 (lists.erl, line 1336) in call from mad_compile:dep/4 (/home/takeshi/src/git/mad/src/mad_compile.erl, line 49) in call from mad_compile:deps/4 (/home/takeshi/src/git/mad/src/mad_compile.erl, line 11)
I can see this is because erlydtl_beam_compiler.beam is not being generated:
takeshi:sample$ find . -name 'erlydtl_beam_compiler.*' ./deps/erlydtl/src/erlydtl_beam_compiler.erl
But if i run make inside folder erlydtl, it gets created: takeshi:sample$ cd deps/erlydtl/ takeshi:erlydtl$ make ... ABRIDGED ... takeshi:erlydtl$ cd - /home/takeshi/tmp/learn/mad/sample takeshi:sample$ find . -name 'erlydtl_beam_compiler.*' ./deps/erlydtl/src/erlydtl_beam_compiler.erl ./deps/erlydtl/ebin/erlydtl_beam_compiler.beam
After that, I can start the app. But when I access http://localhost:8000 I get this in the erlang repl:
=ERROR REPORT==== 6-Dec-2014::20:48:56 === Error in process <0.97.0> with exit value: {[{reason,undef},{mfa,{n2o_cowboy,init,2}},{stacktrace,[{n2o_cowboy,init,[{http_req,#Port<0.16780>,ranch_tcp,keepalive,<0.97.0>,<<3 bytes>>,'HTTP/1.1',{{127,0,0,1},57061},<<9 bytes>>,undefined,8000,<<1 byte>>,undefined,<<0 bytes>>,[],[{<<4 bytes>>,<<14 bytes>>},{<<10 bytes>>,<<76 bytes>>},{<<6 bytes>>,<<63 bytes>>},{<<15 bytes>>,<<14 bytes>>},{<<15 bytes>>,<<13 bytes>>},{<<6 bytes>>,<<65 bytes>>},{<<10 bytes>>,<<10 bytes>>}],[],waiting,<<0 bytes>>,undefined,false,waiting...
=ERROR REPORT==== 6-Dec-2014::20:48:56 === Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.97.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,init,2}},{stacktrace,[{n2o_cowboy,init,[{http_req,#Port<0.16780>,ranch_tcp,keepalive,<0.97.0>,<<"GET">>,'HTTP/1.1',{{127,0,0,1},57061},<<"localhost">>,undefined,8000,<<"/">>,undefined,<<>>,[],[{<<"host">>,<<"localhost:8000">>},{<<"user-agent">>,<<"Mozilla/5.0 (X11; Ubuntu; Linux x8664; rv:34.0) Gecko/20100101 Firefox/34.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.5">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"cookie">>,<<"_ga=GA1.1.1057982470.1417221669; n2o-sid=SZCGG+LCc1OhIFziVocJLQ==">>},{<<"connection">>,<<"keep-alive">>}],[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},[]],[]},{cowboy_handler,execute,2,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_handler.erl"},{line,39}]},{cowboy_protocol,execute,4,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_protocol.erl"},{line,428}]}]},{req,[{socket,#Port<0.16780>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.97.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},57061}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/">>},{path_info,undefined},{qs,<<>>},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">>},{<<"user-agent">>,<<"Mozilla/5.0 (X11; Ubuntu; Linux x8664; rv:34.0) Gecko/20100101 Firefox/34.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.5">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"cookie">>,<<"_ga=GA1.1.1057982470.1417221669; n2o-sid=SZCGG+LCc1OhIFziVocJLQ==">>},{<<"connection">>,<<"keep-alive">>}]},{meta,[]},{body_state,waiting},{buffer,<<>>},{multipart,undefined},{resp_compress,false},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]},{opts,[]}],[{cowboy_protocol,execute,4,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_protocol.erl"},{line,428}]}]}