# Generators not working under Rails 2.1.2?

**URL:** <https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655>\
**Category:** Rails\
**Created:** [October 23, 2008, 11:40pm UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655 "2008-10-23T23:40:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 23, 2008, 11:40pm UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/1 "2008-10-23T23:40:17Z")

</div>

Hello,

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”.

Example:

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

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 24, 2008, 12:20am UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/2 "2008-10-24T00:20:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 24, 2008, 1:31am UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/3 "2008-10-24T01:31:14Z")

</div>

Update the rubygems :

gem update --system

On Fri, Oct 24, 2008 at 3:10 AM, Jason C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Rails 2.1.2  
> mbp15:~/example\>

–  
Cheers!

- Pratik  
[http://m.onkey.org](http://m.onkey.org)

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 24, 2008, 2:09am UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/4 "2008-10-24T02:09:14Z")

</div>

BTW, Google already indexed this:

[http://rails.lighthouseapp.com/projects/8994/tickets/1259-bug-in-edge-rails](http://rails.lighthouseapp.com/projects/8994/tickets/1259-bug-in-edge-rails)

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

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 24, 2008, 2:05am UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/5 "2008-10-24T02:05:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 25, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/6 "2008-10-25T14:46:38Z")

</div>

[http://afreshcup.com/2008/10/25/rails-212-and-22rc1-update-your-rubygems/](http://afreshcup.com/2008/10/25/rails-212-and-22rc1-update-your-rubygems/)

On Sat, Oct 25, 2008 at 4:23 PM, Pratik [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > [http://rails.lighthouseapp.com/projects/8994/tickets/1259-bug-in-edge-rails](http://rails.lighthouseapp.com/projects/8994/tickets/1259-bug-in-edge-rails)
> > 
> > > > > ```
> > > > > ...
> > > > > 
> > > > > ```
> > > > > 
> > > > > Any thoughts? Anyone else experiencing this?
> 
> –  
> Cheers!
> 
> - Pratik  
> [http://m.onkey.org](http://m.onkey.org)

–  
Cheers!

- Pratik  
[http://m.onkey.org](http://m.onkey.org)

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [October 25, 2008, 12:55pm UTC](https://www.ruby-forum.com/t/generators-not-working-under-rails-2-1-2/151655/7 "2008-10-25T12:55:23Z")

</div>

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

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

On Fri, Oct 24, 2008 at 5:34 AM, Pilaf [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > all the latest patches. Pratik’s suggestion did nothing (actually my
> > 
> > > On Fri, Oct 24, 2008 at 3:10 AM, Jason C.
> > > 
> > > > mbp15:~\> rails -v  
> > > > undefined method `empty?’ for /\_generator$/:Regexp
> > > > 
> > > > >
> 
> >

–  
Cheers!

- Pratik  
[http://m.onkey.org](http://m.onkey.org)
