I’m attempting to get ruwiki running under WEBrick on Windows XP. It’s not
working, so I am attempting with a very simple CGI script. Well, that isn’t
working, either.
I’m starting WEBrick with:
···
#!/usr/local/bin/ruby
require 'webrick’
include WEBrick
s = HTTPServer.new(:Port => 2000, :DocumentRoot => Dir::pwd + “/htdocs”)
# mount subdirectories
s.mount("/ruwiki", HTTPServlet::CGIHandler, “C:/Apps/Ruby18/bin/ruby.exe”)
trap(“INT”){ s.shutdown }
s.start
My CGI script is currently called hello.rb, but I’ve tried it as hello.cgi
as well and it doesn’t work:
#!C:/Apps/Ruby18/bin/ruby.exe
hello.pl – my first perl script!
print “Content-type: text/html\n\n”
print <<“EOF”
Hello, world!Hello, world!
EOF
Here’s the error message:
[2003-09-22 13:00:11] INFO WEBrick 1.3.1
[2003-09-22 13:00:11] INFO ruby 1.8.0 (2003-08-04) [i386-mswin32]
[2003-09-22 13:00:11] INFO WEBrick::HTTPServer#start: pid=3268 port=2000
[2003-09-22 13:00:20] ERROR Errno::EACCES: Permission denied -
C:\DOCUME~1\Austin\LOCALS~1\Temp/webrick.cgiout.3268.0
c:/Apps/Ruby18/lib/ruby/1.8/tempfile.rb:143:in unlink' c:/Apps/Ruby18/lib/ruby/1.8/tempfile.rb:143:in
callback’
c:/Apps/Ruby18/lib/ruby/1.8/tempfile.rb:134:in call' c:/Apps/Ruby18/lib/ruby/1.8/tempfile.rb:99:in
close!'
c:/Apps/Ruby18/lib/ruby/1.8/tempfile.rb:90:in close' c:/Apps/Ruby18/lib/ruby/1.8/webrick/httpservlet/cgihandler.rb:59:in
do_GET’
c:/Apps/Ruby18/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in
__send__' c:/Apps/Ruby18/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in
service’
c:/Apps/Ruby18/lib/ruby/1.8/webrick/httpserver.rb:92:in service' c:/Apps/Ruby18/lib/ruby/1.8/webrick/httpserver.rb:54:in
run’
c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:168:in start_thread' c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:162:in
start’
c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:162:in start_thread' c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:114:in
start’
c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:109:in each' c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:109:in
start’
c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:99:in start' c:/Apps/Ruby18/lib/ruby/1.8/webrick/server.rb:99:in
start’
c:/tmp/webrick/server.rb:13
localhost - - [22/Sep/2003:13:00:19 Eastern Daylight Time] “GET
/ruwiki/hello.rb HTTP/1.1” 500 354
- -> /ruwiki/hello.rb
-austin
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.09.22
* 12.44.34