stack level too deep

My specs started failing, I traced the problem to the acts_as_paranoid plugin

I just want to share this since I wasted a lot of time tracking it down.

After upgrading my Mac to Snow Leopard, I ran the specs on my ReviewRamp app and things were failing. Actually I have no idea if or why its related to the OSX upgrade, but it could be just a coincidence. I had been away from this app for a month so maybe I did something several weeks ago to cause it and didn't re-run the spec suite. Who knows. It doesn't matter. What matters is it stopped working. I was getting errors like

"stack level too deep"


vendor/plugins/acts_as_paranoid/init.rb:3:in `belongs_to_without_deleted'

The model that it was failing in didn't even use acts_as_paranoid!

I dissected my app, removing acts_as_paranoid altogether and commenting it out of models that used it, and then my specs passed.

Googling I found some old references to similar cases where that plugin was being initialized more than once, screwing up the alias_method_chain. Digging around some more I found a recent fork to the plugin which fixes the problem.


So I just removed the original acts_as_paranoid and installed the forked on, and all is fine now.

  $ script/plugin install git://github.com/edendevelopment/acts_as_paranoid.git

This really should be merged back into the original technoweenie repository.




by Uri Lewin on Oct 14, 2009


Very helpful pointer, thanks.

New Comment

markdown formatting permitted