From: Mark Pelletier Date: 2007-09-20T06:42:47+09:00 Subject: cgi scripts don't know hostname Forgive me if this is a dumb question, but it's got me stumped. I'm running a WEBrick server and I've mounted HTTPServlet::FileHandler as follows: s.mount("/cgi-bin",HTTPServlet::FileHandler, cgi_dir,{:FancyIndexing=>true}) However, the scripts in the cgi-bin directory can't find the hostname when they're run by the web server. E.g., the following script #!/usr/bin/ruby -w s = %{ Hi #{ENV['HOSTNAME']} Bye } print s prints the html with the machine name embedded in it when I run it from the command line, but only "Hi Bye" when I look at it in the browser. What's up with that? -- Posted via http://www.ruby-forum.com/.