Cgi test failure

Hy,

This standard test fails on:
  server version: Apache/2.0.55

···

---
require 'cgi'

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
      }
    }
  }
}

From logs:
---
Premature end of script headers: eruby
/usr/lib/ruby/1.8/cgi.rb:725:in `out'
private method `print' called for "":String
( NoMethodError )

I think it is caused from $DEFAULT_OUTPUT setted to nil.

How can i fix that?

Tnx, regards.

--

here are more things in heaven and earth,

horatio, than are dreamt of in your philosophy.

--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Vuoi proteggere la tua casa? Chiedi a Ras come, clicca e fai un preventivo online!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid@27&d1-10

I think you started your script with eruby, not with ruby. Have you
named your file
test.erb? In this case try renaming the file to test.rb, chmod it
executable and include a line

#!/usr/bin/ruby

or wherever your ruby executable lives at the beginning of the test
file. If you want to test eruby try this:

--- test.erb ---
<html>
  <body>
    1 + 1 is <%= 1 + 1 %>
  </body>
</html>
--- ---

hope to help,

Brian

···

On 31/10/05, dave <dave.m@email.it> wrote:

Hy,

This standard test fails on:
  server version: Apache/2.0.55

---
require 'cgi'

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
      }
    }
  }
}

From logs:
---
Premature end of script headers: eruby
/usr/lib/ruby/1.8/cgi.rb:725:in `out'
private method `print' called for "":String
( NoMethodError )

I think it is caused from $DEFAULT_OUTPUT setted to nil.

How can i fix that?

Tnx, regards.

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/

I think you started your script with eruby, not with ruby.

Yes, my real target is to use sessions from a .rhtm file.

If you want to test eruby try this:

Eruby works well. But how can i use the cgi module in an .rhtm
file:

<%
  require "cgi"
  ...
%>

is it possible?

···

--

here are more things in heaven and earth,

horatio, than are dreamt of in your philosophy.

--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Giornata faticosa? Rilassati con il Cuscino per Massaggi che vibra!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2742&d=31-10