Friday, February 20, 2009

Stack Level Too Deep!


Site5 recently updated their ruby and rails installations system-wide which, of course, broke the danstewartphotography.com application I've been working on for the past year. Evidently, I had some ruby gem dependencies that needed to be reinstalled and some code the that needed to be "2.2ified".

I was in Boston late this week interviewing for a position with Aptima (great company by the way) and didn't have the time to look much into a problem I was having after freezing my app to Rails 2.0.2: stack level too deep. Typically, this error occurs when you have an infinite loop somewhere in your code, and indeed this was the case for my application, BUT it wasn't my fault! Well, my coding fault anyway.

Turns out, the version of Mislav's awesome will_paginate I was using was causing the error; I'm not sure exactly what the problem was, but the loop initiated in the "method_missing_with_paginate" method in lib/finder.rb. It had something to do with freezing the app to 2.0.2 and this plugin not being compatible.

Long story short, if you're getting a "stack level too deep" error in your ruby app and you're using will_paginate, you probably just need to get the lastet version of the plugin from Mislav's will_paginate github.

1 comment:

Stex said...

You saved me a lot of time! Thanks!