If it’s there, load it!
Posted in Uncategorized on May 4th, 2009 by Marcelo de Moraes Serpa – Be the first to commentI was having some cryptic exceptions on the root route of the application I’m working on, tried everything, from reseting the working copy to an older commit, from testing the very same branch on a colleague’s computer. Interestingly, on my colleague’s environment the app ran fine and I could just not find the reason why it was failing on my env.
Here’s an excerpt from the exception traceback:
$ script/server
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
/!\ FAILSAFE /!\ Mon May 04 12:52:15 -0500 2009
Status: 500 Internal Server Error
Expected /home/project/app/helpers/admin/watchers_helper.rb to define Admin::WatchersHelper
What happens is that I had lots of junk from git (files created from merge conflicts) and also emacs (backup files). Rails was loading it all and this was somehow breaking the app environment. I had a similar issue the other day with view files — Rails was loading the emacs backup file for one particular view, and I was modifying the original file hence I could not see the changes.
The solution?
git clean
Be sure to commit any uncommitted changes before running this command, as it will delete any untracked file in the working tree.
I’m not sure yet why Rails (2.3.2) is doing this, this might be a bug, or a feature, didn’t have the time to dig into it yet, if someone knows, please share!
