# How to debug templates not being rendered?

**URL:** <https://www.ruby-forum.com/t/how-to-debug-templates-not-being-rendered/123509>\
**Category:** Nitro\
**Created:** [December 18, 2007, 10:38am UTC](https://www.ruby-forum.com/t/how-to-debug-templates-not-being-rendered/123509 "2007-12-18T10:38:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [December 18, 2007, 10:38am UTC](https://www.ruby-forum.com/t/how-to-debug-templates-not-being-rendered/123509/1 "2007-12-18T10:38:58Z")

</div>

Hi,

After upgrading to the repo version of Nitro, I’m not seeing  
rendering of my templates. However, it appears the controller  
is behaving normally from watching the log information.

However, when I run the demo/blog app, its templates DO get  
rendered!

So I’m trying to understand what is different between the blog  
and my app.

The directory structure of my app puts template/ at the root:

conf  
log  
public  
public/js  
public/media  
public/stylesheets  
public/doc  
run.rb  
src  
template

However, I have checked the runtime value of Template.root\_dir,  
and it is “template”, so that seems OK.

Note: If I put a print “hello” in one of my controller methods,  
then at least the “hello” DOES show up in the browser.

At this point I’m hoping for some tips on how to debug why my  
templates aren’t being rendered. (Any particularly good places  
in nitro or raw I should add a printout?) It’s not obvious to me  
what is different between my app and the demo/blog app.

(Note: my templates use the extension .htmlx)

Thanks for any ideas,

Regards,

Bill

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [December 18, 2007, 10:51am UTC](https://www.ruby-forum.com/t/how-to-debug-templates-not-being-rendered/123509/2 "2007-12-18T10:51:52Z")

</div>

Bill K. schreef:

> (Note: my templates use the extension .htmlx)

That’s probably the problem, in the current version the x was dropped,  
try renaming them to .html (same for cssx → css).

(ab)

> Thanks for any ideas,
> 
> Regards,
> 
> Bill

–  
Ein Fuchs muß tun, was ein Fuchs tun muß  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [December 18, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/how-to-debug-templates-not-being-rendered/123509/3 "2007-12-18T19:25:42Z")

</div>

From: “Arne B.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Bill K. schreef:
> 
> > (Note: my templates use the extension .htmlx)
> 
> That’s probably the problem, in the current version the x was dropped,  
> try renaming them to .html (same for cssx → css).

Thanks, I’ve tried that now, but it made no difference.

When I use strace on the demo/blog app, I can see nitro reading the  
template files:

stat64(“app/template/view.html”, {st\_mode=S\_IFREG|0640, st\_size=133,  
…}) = 0  
open(“app/template/view.html”, O\_RDONLY|O\_LARGEFILE) = 7  
stat64(“app/template/post.inc.html”, {st\_mode=S\_IFREG|0640, st\_size=242,  
…}) = 0  
open(“app/template/post.inc.html”, O\_RDONLY|O\_LARGEFILE) = 7

However, when I strace my app, I don’t see nitro ever trying to  
read my template files.

Not sure why…

At this point I guess I’ll be putting some printouts in nitro  
and raw to try to understand how it works… Any tips would be  
appreciated… 🙂

Regards,

Bill

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [December 18, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/how-to-debug-templates-not-being-rendered/123509/4 "2007-12-18T20:08:02Z")

</div>

From: “Bill K.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> However, when I strace my app, I don’t see nitro ever trying to  
> read my template files.
> 
> Not sure why…
> 
> At this point I guess I’ll be putting some printouts in nitro  
> and raw to try to understand how it works… Any tips would be  
> appreciated… 🙂

Auuugh!

It was the debugging printout I had added to my controller method,  
when things initially weren’t working, that prevented it from ever  
working again no matter what I tried… ☹

Initially when my templates didn’t render, I put a: print “fubar”  
as the last line of my controller method. So I could see the  
“fubar” on the web page…

I didn’t realize that would prevent templates from being processed  
going forward…

LOL ☹

Regards,

Bill
