indentifier needs to be constant error when calling

In my current rails application, I now have the following issue:

Loading development environment.
>> bob =
NameError: identifier anysymbol needs to be constant
         from (irb):1:in `new'
         from (irb):1
>> exit

This occurs regardless of what symbols are passed to call.

Consequently, nothing that uses Struct will work anymore. I discovered this when attempting to use Fastercsv, which fails when required.

I'm completely mystified by this error and have little idea how to go about tracking down what is causing it, short of rebuilding my application one step at a time. It's fairly big to be doing with at this point.

What could cause such a problem?

I've made no monkeypatches to Struct. I can't find any code messing with Struct among the plugins I've installed.


Michael Johnston

whew. I managed to discover this relatively quickly once I quelled my

It was caused by an extension called acts_as_wizard, which
monkeypatches Symbol thusly:

class Symbol
...some other monkeycrap^H^H^H^Hpatching
   def to_str

I'm not entirely sure how this ends up breaking, but it
does. It's a lame patch anyway, he should just use id2name or "#
{mysymbol}" instead of making such a patch. Coercions and other such
things that are likely to be pervasively used outside of the code you
are writing are bad bad targets for monkeypatching.

Since the time I installed acts_as_wizard, I have stopped using it
and written my own wizard management code, so luckily I can easily
just pitch this plugin.

Michael Johnston