I tried the following basic cgi from the “Pickaxe”:
require “cgi"
cgi = CGI.new(“html3”) # add HTML generation methods
cgi.out{
cgi.html{
cgi.head{ “\n”+cgi.title{“This Is a Test”} } +
cgi.body{ “\n”+
cgi.form{”\n"+
cgi.hr +
cgi.h1 { “A Form: " } + “\n”+
cgi.textarea(“get_text”) +”\n"+
cgi.br +
cgi.submit
}
}
}
}
When I try to run this in my browser I get an error, so I checked my error_log to see what the problem was and found the following:
[Tue Nov 26 12:53:56 2002] [error] mod_ruby: error in ruby
/Library/WebServer/CGI-Executables/ruby/test.rb:5: undefined method html' for #<CGI:0x4c1a30> (NameError) from /Library/WebServer/CGI-Executables/ruby/test.rb:4:in
out’
from /Library/WebServer/CGI-Executables/ruby/test.rb:4
from /usr/lib/ruby/1.6/apache/ruby-run.rb:70:in load' from /usr/lib/ruby/1.6/apache/ruby-run.rb:70:in
handler’
from ruby:0
This looks like it is sayong that html is an undefined method. What am I doing wrong here?
Thanks.
SA