Attempt to Use Mochiweb Failed:(

150 views
Skip to first unread message

Enhnaran

unread,
Jul 16, 2008, 8:11:54 AM7/16/08
to MochiWeb
Hi, everyone.

Today I tried to make my own code using Mochiweb but failed.

My environment: MS Windows2003; MINGW-5.1.4; MSYS-1.0.10; Erlang(BEAM)
emulator 5.6.3.

Repro steps are as follows (with the result in the parenthesis):

1. make Mochiweb. (succeeded)
2. run the command "escript scripts/new_mochiweb.erl mochidemo" under
the directory /mochiweb, where mochidemo is my own test project
directory.
(the result is as follows:
./mochidemo/
./mochidemo/support/
include.mk
start.sh
start-dev.sh
./mochidemo/src/
skel_web.erl
skel_sup.erl
skel_deps.erl
skel_app.erl
skel.hrl
skel.erl
skel.app
Makefile
./mochidemo/priv/
./mochidemo/priv/www/
index.html
Makefile
./mochidemo/include/
./mochidemo/ebin/
./mochidemo/doc/
./mochidemo/deps/
escript: exception error: no match of right hand side value
{error,enotsup}
in function mochiweb_skel:skelcopy/2
)
3. make mochidemo. (succeeded)
4. run command "start-dev.sh" under the directory /mochidemo.
(the result is as follows:
=PROGRESS REPORT==== 16-Jul-2008::19:45:43 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.32.0>},
{name,alarm_handler},
{mfa,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::19:45:43 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.33.0>},
{name,overload},
{mfa,{overload,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::19:45:43 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.31.0>},
{name,sasl_safe_sup},
{mfa,
{supervisor,start_link,
[{local,sasl_safe_sup},sasl,safe]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::19:45:43 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.34.0>},
{name,release_handler},
{mfa,{release_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::19:45:43 ===
application: sasl
started_at: nonode@nohost
{"init terminating in do_boot",{undef,[{reloader,start,[]},
{init,start_it,1},{init,start_em,1}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
)

As a result, I couldn't access http://127.0.0.1:8000, which implied
that the web server was not working well.

Can anyone be so kind as to help me?

Thanks,
Enhnaran

Bob Ippolito

unread,
Jul 16, 2008, 12:05:36 PM7/16/08
to moch...@googlegroups.com
You need to put a copy of mochiweb in "deps".

Enhnaran

unread,
Jul 17, 2008, 2:44:30 AM7/17/08
to MochiWeb
Hi, Bob

I have put a copy of mochiweb in "deps", namely mochidemo\deps, but it
still couldn't work, and http://127.0.0.1:8000 couldn't be accessed.

Could you please help me and let me know why this occurred?

Thanks,
Enhnaran

On 7月17日, 上午12时05分, "Bob Ippolito" <b...@redivi.com> wrote:
> You need to put a copy of mochiweb in "deps".
>
> > As a result, I couldn't accesshttp://127.0.0.1:8000, which implied

Abhay Kumar

unread,
Jul 17, 2008, 1:09:12 PM7/17/08
to moch...@googlegroups.com
Enhnaran,

It looks like this line is what you should be concerned about:


>>>
>>> escript: exception error: no match of right hand side value
>>> {error,enotsup}
>>> in function mochiweb_skel:skelcopy/2
>>> )

Either mochiweb isn't building properly or there is some other problem
with the skel copy script on your machine. I cannot reproduce this
error that you are having.

- Abhay

Matthew Dempsky

unread,
Jul 17, 2008, 1:23:10 PM7/17/08
to moch...@googlegroups.com
{error,enotsup} is probably from trying to setup the symlink in the
deps directory.

On UNIX, after running the new project script, there will be a symlink
called "deps/mochiweb-src" which points to the root directory of
mochiweb. E.g., there should be "deps/mochiweb-src/src/" containing
all of the .erl files, and "deps/mochiweb-src/ebin/" containing all of
the .beam files.

If this doesn't work, then we need more output from how you're trying
to startup Erlang. At least the commands you're invoking, from what
directory, and all of Erlang's start up messages.

Enhnaran

unread,
Jul 19, 2008, 5:08:12 AM7/19/08
to MochiWeb
Thanks to Matthew, and you all.

On Windows system, links are not supported, so when I used MINGW and
msys to make erlang programs, the fu make_link returned {error,
enotsup}. But Unix-like systems support links, so a directory mochiweb-
src is created under "deps" in my project, hence the error I met
cannot be reproduced here.

I adopted coLinux at length, and it works now. Thanks to all you
again.

Enhnaran

On 7月18日, 上午1时23分, "Matthew Dempsky" <matthew.demp...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages