M
Mark Wilson
How do I tell Webrick to use ruby to execute a cgi program? The
following code example just shows me the script and not the result of
executing the program:
#!/usr/local/bin/ruby
require 'webrick'
include WEBrick
s = HTTPServer.new(
ort => 2000,
ocumentRoot => Dir:wd + "/htdocs"
)
s.mount("cgi-bin", HTTPServlet::CGIHandler, '/usr/local/bin/ruby')
trap("INT") { s.shutdown }
s.start
I've tried several variations of the above, googled the web and
ruby-talk, checked the RDoc for Webrick (nothing there, by the way),
looked at the source for HTTPServlet::CGIHandler, checked the Webrick
website, etc.
The file I point my browser to is in the 'htdocs/cgi-bin' directory and
both the directory and the file are made executable. I am also the
owner of the site directory, all subdirectories and all files.
Webrick strikes me as an excellent addition to Ruby and I am looking
forward to learning how to use it.
I am also looking forward to a "doh!" moment on my question
Regards,
Mark
following code example just shows me the script and not the result of
executing the program:
#!/usr/local/bin/ruby
require 'webrick'
include WEBrick
s = HTTPServer.new(
ort => 2000,
ocumentRoot => Dir:wd + "/htdocs"
)
s.mount("cgi-bin", HTTPServlet::CGIHandler, '/usr/local/bin/ruby')
trap("INT") { s.shutdown }
s.start
I've tried several variations of the above, googled the web and
ruby-talk, checked the RDoc for Webrick (nothing there, by the way),
looked at the source for HTTPServlet::CGIHandler, checked the Webrick
website, etc.
The file I point my browser to is in the 'htdocs/cgi-bin' directory and
both the directory and the file are made executable. I am also the
owner of the site directory, all subdirectories and all files.
Webrick strikes me as an excellent addition to Ruby and I am looking
forward to learning how to use it.
I am also looking forward to a "doh!" moment on my question
Regards,
Mark