On Fri, 2006-05-26 at 04:49 -0400, Josh Ferguson wrote:
> When I try 'listener :port => 3000 do' I get a bind (port already in 
> use) error.
> 
Hey Josh, try a different port.  Mostly likely you have something
already running on 3000.  If you are passing this to mongrel_rails with
-S then you only need the "uri ..." statement.   Not the whole
Configurator class and so on.


> The script above however starts up but http://localhost:3000/downloads 
> doesn't start up the handler. The process method of my handler is never 
> called, I just get a routing error from rails.
> 
Well, if you can run rails actions then handlers are working.  You'll
have to first make sure it binds to the right port, or just use -S and
pass it a file with only your "uri ..." statement.  Then it should all
work (with rails that is).

> 2) When I pass in the options to the plugin like this how do I get to 
> the options hash while inside of the process method?

Since you are using the plugin system, you get a few things for free:

  *  listener is the listener that this handler is working with.
  *  @options are the options that you were given.

And @options is a hash.  You can override this behavior by defining your
own initialize method, and if you need something really really different
then you can use the HttpHandler class which defines almost nothing.

> 
> Note: I also tried to get just the DirHandler example working and I 
> couldn't get the server to recognize that path either, so there might be 
> something more sinister going on here.
> 
Well, considering it works for rails I'll have to say you need to go
back and review what you've done.  If you're passing the code you showed
to -S then all you have to do is strip out everything but the "uri ..."
line and it should pick right up.

> Any help appreciated. If I can get this to recognize my handler I'll 
> almost have it working. Is there a wiki I could do a writeup on as to 
> how to write handlers after I get this finished?

http://mongrel.rubyforge.org/docs/contrib.html

That's instructions on how to contribute documentation.  I'm avoiding a
wiki until I can get a fixed set of documentation done up that the wiki
could be based on.


-- 
Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/


_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to