J
Jon A. Lambert
I'm running Apache 2.0.43 on Windows XP and trying to setup erb (eruby?).
I receive the following in the apache error.log
[error] [client 10.0.0.2] Premature end of script headers: erb
My http.conf configuration contains:
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/erb
I do not have mod_ruby nor mod_cgi installed. I can however execute
Perl and Ruby scripts in the cgi-bin directory.
I'm using the test eruby web page from the The Pragmatic Programmers help file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>eruby example</title>
</head>
<body>
<h1>Enumeration</h1>
<ul>
<%(1..10).each do|i|%>
<li>number <%=i%></li>
<%end%>
</ul>
<h1>Environment variables</h1>
<table>
<%ENV.keys.sort.each do |key|%>
<tr>
<th><%=key%></th><td><%=ENV[key]%></td>
</tr>
<%end%>
</table>
</body>
</html>
Interestingly enough in running the a ruby script copied from the same help file
I was getting this error:
malformed header from script. Bad header=HTTP/1.0 200 OK: rubytest.rb
until I commented out the print statement that produces the header.
#!c:\apps\ruby\bin\ruby
#
#print "HTTP/1.0 200 OK\r\n"
print "Content-type: text/html\r\n\r\n"
print "<html><body>Hello World!</body></html>\r\n"
So I tried a number of similar variations for the erb/rhmtl page with no success.
What am doing wrong here?
Thanks
I receive the following in the apache error.log
[error] [client 10.0.0.2] Premature end of script headers: erb
My http.conf configuration contains:
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/erb
I do not have mod_ruby nor mod_cgi installed. I can however execute
Perl and Ruby scripts in the cgi-bin directory.
I'm using the test eruby web page from the The Pragmatic Programmers help file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>eruby example</title>
</head>
<body>
<h1>Enumeration</h1>
<ul>
<%(1..10).each do|i|%>
<li>number <%=i%></li>
<%end%>
</ul>
<h1>Environment variables</h1>
<table>
<%ENV.keys.sort.each do |key|%>
<tr>
<th><%=key%></th><td><%=ENV[key]%></td>
</tr>
<%end%>
</table>
</body>
</html>
Interestingly enough in running the a ruby script copied from the same help file
I was getting this error:
malformed header from script. Bad header=HTTP/1.0 200 OK: rubytest.rb
until I commented out the print statement that produces the header.
#!c:\apps\ruby\bin\ruby
#
#print "HTTP/1.0 200 OK\r\n"
print "Content-type: text/html\r\n\r\n"
print "<html><body>Hello World!</body></html>\r\n"
So I tried a number of similar variations for the erb/rhmtl page with no success.
What am doing wrong here?
Thanks