UPDATE: this problem was simply due to the app having an existing class called StateMachine… see the answers section.
Hi,
I’m having an irritating problem: after adding state_machine to my bundle for a Rails 2.3.11 app, something breaks.
Symptoms:
- vendor/plugins seem not to be loaded – acts_as_paranoid and acts_as_lists at least, resulting in “undefined method ‘acts_as_paranoid” etc.
- removing those plugins, trying to narrow in on the problem, i get
“undefined method ‘state_machine'”, indicating that the state_machine gem is not loaded either, even though it’s defined in the bundle (yes, i’ve run ‘bundle install’ and verified that it got in)
This hints me that something is breaking in the rails boot/loading of gems and plugins, and that the state_machine gem might cause this. I’ve tried with almost all versions of state_machine from 0.7.0 to 1.0.0
My question: Where to look for information to hint me of what’s wrong?
I know little of debugging Rails during loadtime – so any directions is welcome 🙂
The problem was apparently due to a naming conflict, since the app already had an observer class called StateMachine.
So – stupid me, should have known.
I resolved by building a separate app, adding stuff little at a time, until stumbling over the ‘violating’ code by accident. Still it feels like attacking the issue in a structured manner was the right way forward.
I could have used more knowledge on load time life cycle and debugging though.