Calamity Lane

Curious Code for Curious Coders

Mysterious, Incomprehensible Capistrano Errors

So yesterday a co-worker and I were fighting fires in our Capistrano deploy scripts. We’d been updating a crufty monstrosity of a cap script, and were getting an error along the lines of:

uninitialized constant #<Class:0x7f3230382cf0>::Capistrano::Deploy

After half a day of rolling back every single change we’d made to the scripts in the last week, we discovered a small junk file with some test code we’d stuck in the ‘lib/recipes’ directory. It was getting included even though it was not ‘require’d anywhere.

PROTIP: CAPISTRANO INCLUDES EVERYTHING IN THE ‘lib/recipes’ DIRECTORY BECAUSE IT HATES YOU.

Also, it saves typing maybe three lines of code.