Problems when calling rendering a template from a cron job


I am trying to use a cron job to render and mail pdf files on a daily
basis. Problem is that this code doesn't compile and render the
template; it just passes the embedded ruby code on as text.

app =
app.controller =
data = app.render_template('rhtml', "path_to_template/template.rhtml")
pdf << data

Reason that I use render_template is that render_to_string, which I
originally used, is a protected method... and if I try to bypass that
with send, I get a null pointer exception.