From: Matt Date: 2001-07-24T05:15:35+09:00 Subject: [ruby-talk:18378] More newbie questions OK. Now that I have Ruby installed and apparently (mostly) working, I'm trying my hand at simple things. (At least they seem like they'd be simple enough...) In order to help me figure out what I'm doing wrong, could someone explain this for me? $ ruby require "cgi" cgi = CGI.new("html3") cgi.out { cgi.p { "Hello, world!" } } (offline mode: enter name=value pairs on standard input) Content-Type: text/html Content-Length: 20

Hello, world!

$ $ ruby require "cgi" cgi = CGI.new("html3") cgi.out { cgi.p { cgi.rfc1123_date (Time.now) } } (offline mode: enter name=value pairs on standard input) -:3: undefined method `rfc1123_date' for # (NameError) from -:3:in `p' from -:3 from -:3:in `out' from -:3 $ ruby require "cgi" cgi = CGI.new("html3") cgi.out { cgi.p { Time.now.asctime } } (offline mode: enter name=value pairs on standard input) Content-Type: text/html Content-Length: 31

Mon Jul 23 13:16:29 2001

$ In other words, why do the first and last examples work, but the second one doesn't? It seems like it should, right? It's ok to thwap me for royally screwing up if I shoulda just read better... ;) But this IS part of the first project I'm doing in Ruby... It's all been theory for me till now. --Matt