M
Mitul Ti
I am trying to run embedded ruby inside rhtml.
$cat test.rhtml
<% print "Content-type: text/html\n\n" %>
<html>
<body>
Testing <% foo = "Ruby"; print "#{foo}!" %>
</body>
</html>
It works fine from the command line:
$eruby test.rhtml
Content-type: text/html
<html>
<body>
Testing Ruby!
</body>
</html>
But inside my apache setup it doesn't work.
Accessing "http://localhost/cgi-bin/test.rhtml" gives following error:
"Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, (e-mail address removed) and inform them
of the time the error occurred, and anything you might have done that
may have caused the error.
More information about this error may be available in the server error
log."
Error log says:
[Wed Jan 26 13:21:53 2011] [error] [client ::1] (8)Exec format error:
exec of 'Dir/cgi-bin/test.rhtml' failed
[Wed Jan 26 13:21:53 2011] [error] [client ::1] Premature end of script
headers: test.rhtml
I have copied "eruby" executable to "Dir/cgi-bin/" directory and
configured apache (2.2) as follows:
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby Dir/cgi-bin/eruby
Any ideas? Thanks!
$cat test.rhtml
<% print "Content-type: text/html\n\n" %>
<html>
<body>
Testing <% foo = "Ruby"; print "#{foo}!" %>
</body>
</html>
It works fine from the command line:
$eruby test.rhtml
Content-type: text/html
<html>
<body>
Testing Ruby!
</body>
</html>
But inside my apache setup it doesn't work.
Accessing "http://localhost/cgi-bin/test.rhtml" gives following error:
"Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, (e-mail address removed) and inform them
of the time the error occurred, and anything you might have done that
may have caused the error.
More information about this error may be available in the server error
log."
Error log says:
[Wed Jan 26 13:21:53 2011] [error] [client ::1] (8)Exec format error:
exec of 'Dir/cgi-bin/test.rhtml' failed
[Wed Jan 26 13:21:53 2011] [error] [client ::1] Premature end of script
headers: test.rhtml
I have copied "eruby" executable to "Dir/cgi-bin/" directory and
configured apache (2.2) as follows:
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby Dir/cgi-bin/eruby
Any ideas? Thanks!