Generators not working under Rails 2.1.2?


On all of my Rails 2.1.2 projects (released today), whenever I try to generate anything, I get the result "undefined method `empty?' for /_generator$/:Regexp".


mbp15:~> rails -v Rails 2.1.2 mbp15:~> rails ./example       create       ...       ...

mbp15:~> cd example mbp15:~/example> ./script/generate model my_model name:string undefined method `empty?' for /_generator$/:Regexp mbp15:~/example> ./script/generate migration my_first_migration undefined method `empty?' for /_generator$/:Regexp mbp15:~/example>

Any thoughts? Anyone else experiencing this?

Thanks, -Jason

Installed the latest version of Ruby Enterprise Edition (though normal Ruby would probably work too) and everything is fine now.

I think I had a patched version leftover from a security issue that arose earlier this summer, and the latest version of Rails didn't like it so much.

Cheers, -Jason

Update the rubygems :

gem update --system

I'm having the same problem. I'm on a Gentoo box with Ruby 1.8.6 and all the latest patches. Pratik's suggestion did nothing (actually my rubygems was already up-to-date).

I'm downgrading to 2.1.1 if no quick solution comes up soon.

BTW, Google already indexed this:

Thought I might post it here in case someone finds a solution and posts it over there.

My bad. I didn't provide the complete update instructions :

[lifo@null ~]$ sudo gem update --system [lifo@null ~]$ sudo update_rubygems