8. Create a default layout for all controllers: app/views/layouts/application.rhtml (If you have a controller needing its own layout, just create one called, “controller.rhtml”) Here is a basic application.rhtml:

Applebees isn’t the fanciest place around, but they don’t reduce themselves to fast-food trickery by bribing children with worthless plastic toys. “Oh, really? What is it?”

“An iPod Nano,” he responds.

“Wow, that sounds like a pretty good deal. I don’t know of many kindergarteners with an iPod.”

“Yep. It is right here in my pocket,” he tells me…tapping his front pocket on his pants.

“Let me see that…” I can tell there is something in his pocket, so I try to retrieve the item.

“I’ll show you!”

Sure enough, Asher produces a silver iPod Nano from his pocket. He connects the earbuds to his ears and begins selecting his playlist.

“Wait a minute. Where did you get that?”

With a crooked grin and one eyebrow raised he tries to convince me, “It was part of my meal at Applebees.”

“I already know that is your mom’s iPod.”

Asher giggles.

It turns out, he had it in his pocket all day. I’m not a big fan of the thing since Apple’s latest firmware chokes when used with Linux, but it must be pretty indestructible if it can survive a day in Asher’s pants.

Working on the annual Christmas newsletter I remembered a story about Asher. I figured I’d better record it before I forget.

In the afternoon on Easter, Tina had gone to visit her grandparents. I stayed home with the kids because they were all just a little sick. I was busy cooking dinner when Asher approached me in the kitchen.

Motioning toward the paper towels, “Can I have one of those that is a little bit wet?” he asked.

“Why do you need one?”

“Because this is leaking,” he responded, holding a plastic Easter egg in his right hand.

“What is it leaking?” I asked.

I assumed he had filled it with water from the bathroom sink or something similar.

“Pee,” he responded, as if I should have known that already.

“PEE!?!? How did it get pee in it?”

“I peed in it.” (I guess I should have known the answer to that one.)

“Asher, why would you do that?”

Sensing he was about to get into trouble he responded, “Well, I told the truth.”

Then we began our second treasure hunt of the day. This time, we had to find all of the places on the floor where pee had leaked out of the egg. Asher ended up not getting into trouble. I think I forgot after laughing about the whole thing.

The default rails welcome page worked fine, but I kept getting “Application Error” on everything else. The logs showed nothing. I found several message board posts pointing to the permissions on the “public” folder. Dr. Chuck had the best article on the subject.

Dr. Chuck’s instructions fixed the problem for a month or two. Then it stopped working again. I figured some server-side process had changed the permissions on my files. So, I set it up again. It still didn’t work.

I actually had to contact tech support. A couple of days later they responded with the solution (thankfully, this isn’t a mission-critical app). Hostmonster had recently updated to a newer version of Rails. So, I just commented out the version in the rails environment file:

I believe that tells the application to use whatever version of rails it can find (the most recent version on the server). Since version 1.2.5 had apparently been replaced with 1.2.6, removing the declaration for 1.2.5 fixed the problem.

The part that still confuses me is, I had tried generating the application from scratch while logged into the Hostmonster server (via ssh). Doing so still generated an environment.rb file for version 1.2.5.

Of course, the other part that confuses me is why did 1.2.5 stop working? When I update my own servers with ‘gem update’, I keep old versions available for backwards compatibility of existing rails apps. As far as I know, there is no problem doing it this way. Am I wrong?