Emacs backup files and Rails woes
Today I was modifying an erb view and no matter what I did, the changes wouldn’t be reflected in the browser. First I thougtht it was a cache issue, checked the cache_classes configuration option in config/environments/development.rb. No, set to false, so the views were supposed to be refreshed without the need to restart the server.
“It might be the browser cache” — I quickly thought. Cleared the cache and the view still didn’t reflect the changes.
What the hell? I was starting to feel my head hot. Well, the thing was that Rails was loading an old version of the view file, specifically a file that emacs creates as a backup file, with the extension .~n~ where n is a number. The solution? Delete the file! I don’t know why it happens, didn’t have time to dig into that yet, but here’s this post in the hope it will save’s someone else’s precious time.
By the way, I’m using Rails 2.3.2. Might not happen in an older version, or might be fixed in a next release.

Crazy stuff! This costs me (incrementally) a few hours over the last week. I finally know that it is happening, but I can’t believe that there’s so few of us getting bit by it.
Have the textmate crowd completely subsumed all of the emacs users in the world? That would depress me.
Hey Brian,
Indeed, crazy stuff, I was bited by it more than once, and I lost precious time. I found out how to setup emacs to save the backup files in a different folder instead of saving it in the same level as the file, which causes these kind of problems. I will be postin about this soon.
Thanks for visting my place
Marcelo.