ruby httpd/cgi server for a directory

J

Jim

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
 
K

khaines

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 Haines
 
Z

Zed Shaw

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.
 
J

Jim

Jim said:
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
 

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
474,209
Messages
2,571,089
Members
47,689
Latest member
kilaocrhtbfnr

Latest Threads

Top