[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby httpd/cgi server for a directory

Jim

8/14/2006 1:41:00 PM

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

4 Answers

khaines

8/14/2006 1:51:00 PM

0

Zed A. Shaw

8/14/2006 5:58:00 PM

0

On Mon, 2006-08-14 at 22:50 +0900, khaines@enigo.com wrote:
> 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.

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


--
Zed A. Shaw
http://www.ze...
http://mongrel.ruby...
http://www.railsma... -- Need Mongrel support?


Jim

8/15/2006 12:46:00 PM

0


Thanks, fellers.

Jim

8/17/2006 2:36:00 PM

0


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