Mongrel 0.3.2 Strangely Silent

J

Jim Weirich

I wanted to check out the latest ruby craze: Mongrel. So I installed
mongrel as a gem, whipped up a small example based on the docs. But no
joy. Running the script shows no output on the terminal and a browser
trying to load the url just keeps spinning the "in-progress" indicator.

Here's the script:

------------------------------------
#!/usr/bin/env ruby

require 'mongrel'

class SimpleHandler < Mongrel::HttpHandler
def process(request, response)
response.start(200) do |head,out|
head["Content-Type"] = "text/plain"
out.write("hello!\n")
end
end
end

h = Mongrel::HttpServer.new("0.0.0.0", "3030")
h.register("/test", SimpleHandler.new)
h.register("/files", Mongrel::DirHandler.new("."))
h.run.join
-----------------------------------------

The web addess I tried was http://localhost:3030. Also tried
http://traken:3030 (where traken is the name of the host). I also tried
using "localhost" explicitly in the script instead of "0.0.0.0".

What am I missing here?
 
Z

Zed Shaw

Hey Jim,

Yeah, looks like I didn't regression test the new timeout code outside of
Ruby on Rails. Doh!

Your stuff should run if you do ruby -rtimeout for now. I'm posting a new
release as we speak to include this one-line fix.

Thanks for catching it.

Zed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top