The subdirs of the samples/ directory, doesn't contain any README files
(except samples/drb/).
For instance I attempted to get webrick to work.. I couldn't find any
guides on google, on how to run webrick .. so I thought there had to
be something in the samples dir with ruby. There was these files:
demo-app.rb demo-servlet.rb hello.cgi httpd.rb
demo-multipart.cgi demo-urlencoded.cgi hello.rb httpsd.rb
I started with the first file 'demo-app.rb'.. and nothing happened.
Then I tried the second file 'demo-multipart.cgi'.. and nothing happened.
Then I thought ah.. lets try the hello program...
bash-2.05b$ ruby hello.rb
bash-2.05b$ ./hello.cgi
/usr/lib/ruby/1.8/webrick/cgi.rb:139:in `initialize': invalid CGI environment
(WEBrick::CGI::CGIError)
from /usr/lib/ruby/1.8/webrick/cgi.rb:43:in `new'
from /usr/lib/ruby/1.8/webrick/cgi.rb:43:in `start'
from ./hello.cgi:11
bash-2.05b$
Still no luck.
Finally I tried 'httpd.rb' and it webrick began working for me.
bash-2.05b$ ruby httpd.rb
[2004-10-25 00:32:28] INFO WEBrick 1.3.1
[2004-10-25 00:32:28] INFO ruby 1.8.1 (2004-04-24) [i386-linux-gnu]
[2004-10-25 00:32:28] DEBUG TCPServer.new(::, 10080)
[2004-10-25 00:32:28] DEBUG TCPServer.new(0.0.0.0, 10080)
[2004-10-25 00:32:28] WARN TCPServer Error: Address already in use - bind(2)
[2004-10-25 00:32:28] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2004-10-25 00:32:28] DEBUG HelloServlet is mounted on /hello.
[2004-10-25 00:32:28] DEBUG DemoServlet is mounted on /urlencoded.
[2004-10-25 00:32:28] DEBUG DemoServlet is mounted on /multipart.
[2004-10-25 00:32:28] INFO WEBrick::HTTPServer#start: pid=23718 port=10080
I can now access it via Mozilla with this url:
http://localhost:10080/
I were very close rejecting webrick.
Please add README files to all subdirs, so we can avoid this.
···
--
Simon Strandgaard
i have found the following pages useful in working with my webrick app:
http://shogo.homelinux.org/~ysantoso/webrickguide/html/html_webrick.html
http://segment7.net/projects/ruby/WEBrick/servlets.html
http://www.learningruby.com/usingwebrick.shtml
and of course:
http://www.webrick.org/
and a good google search turns up a few more.
hth,
sean
···
On Mon, 25 Oct 2004 05:49:58 +0900, Simon Strandgaard <neoneye@adslhome.dk> wrote:
The subdirs of the samples/ directory, doesn't contain any README files
(except samples/drb/).
For instance I attempted to get webrick to work.. I couldn't find any
guides on google, on how to run webrick .. so I thought there had to
be something in the samples dir with ruby. There was these files:
demo-app.rb demo-servlet.rb hello.cgi httpd.rb
demo-multipart.cgi demo-urlencoded.cgi hello.rb httpsd.rb
I started with the first file 'demo-app.rb'.. and nothing happened.
Then I tried the second file 'demo-multipart.cgi'.. and nothing happened.
Then I thought ah.. lets try the hello program...
bash-2.05b$ ruby hello.rb
bash-2.05b$ ./hello.cgi
/usr/lib/ruby/1.8/webrick/cgi.rb:139:in `initialize': invalid CGI environment
(WEBrick::CGI::CGIError)
from /usr/lib/ruby/1.8/webrick/cgi.rb:43:in `new'
from /usr/lib/ruby/1.8/webrick/cgi.rb:43:in `start'
from ./hello.cgi:11
bash-2.05b$
Still no luck.
Finally I tried 'httpd.rb' and it webrick began working for me.
bash-2.05b$ ruby httpd.rb
[2004-10-25 00:32:28] INFO WEBrick 1.3.1
[2004-10-25 00:32:28] INFO ruby 1.8.1 (2004-04-24) [i386-linux-gnu]
[2004-10-25 00:32:28] DEBUG TCPServer.new(::, 10080)
[2004-10-25 00:32:28] DEBUG TCPServer.new(0.0.0.0, 10080)
[2004-10-25 00:32:28] WARN TCPServer Error: Address already in use - bind(2)
[2004-10-25 00:32:28] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2004-10-25 00:32:28] DEBUG HelloServlet is mounted on /hello.
[2004-10-25 00:32:28] DEBUG DemoServlet is mounted on /urlencoded.
[2004-10-25 00:32:28] DEBUG DemoServlet is mounted on /multipart.
[2004-10-25 00:32:28] INFO WEBrick::HTTPServer#start: pid=23718 port=10080
I can now access it via Mozilla with this url:
http://localhost:10080/
I were very close rejecting webrick.
Please add README files to all subdirs, so we can avoid this.
--
Simon Strandgaard