Ruby httpd/cgi server for a directory

Hello,

I have a set of ruby scripts I run manually from the command line. I’d
like to put a simple web front-end to them and use them as cgi scripts.
I also want to be able to keep them on a USB stick and run them
anywhere Ruby is installed. All config files and generated data will be
read and written to the directory.

Which is the best/easiest to use: webrick, lighttpd, mongrel, or
something else?

Thanks

On Mon, 14 Aug 2006, Jim wrote:

I have a set of ruby scripts I run manually from the command line. I’d
like to put a simple web front-end to them and use them as cgi scripts.
I also want to be able to keep them on a USB stick and run them
anywhere Ruby is installed. All config files and generated data will be
read and written to the directory.

Which is the best/easiest to use: webrick, lighttpd, mongrel, or
something else?

webrick. It’s standard with Ruby and is capable and flexible. It’s not
nearly so fast as mongrel, but is plenty fast for what you describe.

Kirk H.

Thanks, fellers.

On Mon, 2006-08-14 at 22:50 +0900, [email protected] wrote:

webrick. It’s standard with Ruby and is capable and flexible. It’s not
nearly so fast as mongrel, but is plenty fast for what you describe.

Yep, webrick’s the way to go there. That way no extra software is
installed.

Jim wrote:

Thanks, fellers.

Well, I can’t seem to get this to work. Any suggestions?

server.rb:

#!/usr/local/bin/ruby
require ‘webrick’
include WEBrick

s = HTTPServer.new(
:Port => 2000,
:DocumentRoot => Dir::pwd
)

trap(“INT”){ s.shutdown }
s.start

=====
test.cgi: (in same sirectory as server.rb)

#!c:/ruby/bin/ruby.exe

print “Content-type: text/html\n\n”

puts “Hi”

I get

Internal Server Error
Premature end of script headers: E:/directory/test.cgi
WEBrick/1.3.1 (Ruby/1.8.4/2006-04-14) at localhost:2000

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs