Cgi test failure.

D

dave

Hy,

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


=2D--
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
}
}
}
}


=46rom logs:
=2D--
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.



=2D-=20
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=4027&d=31-10
 
B

Brian Schröder

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.


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 <%=3D 1 + 1 %>
</body>
</html>
--- ---

hope to help,

Brian
 
D

dave

|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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top