NoMethodError: undefined method `enumerate' for # #5

burlesona opened this Issue Jul 25, 2011 · 8 comments


None yet

6 participants


I'm getting a NoMethodError for enumerate in my ActiveRecord models. I followed the site instructions exactly, can interact with Enum classes in Console.

Running Rails 3.0.9 and MRI 1.9.2.

adzap commented Jul 28, 2011

Try uncommenting the extend_clases in the config. It used to detect AR automatically and extend it.

I had this problem too but uncommenting the suggested line solved my problem.

adzap commented Sep 1, 2011

Pushed a new release that should fix this in Rails with a Railtie.

@adzap adzap closed this Sep 1, 2011
ccmcbeck commented Jul 7, 2012

Using rails 3.2.6 and active_enum 0.9.8 (latest on gem install), I also had to uncomment the extend_classes parm to get enumerable to work. IAE, this is a wonderful (forking brilliant, actually) gem -- especially with the i18n support.

adzap commented Jul 8, 2012

Damn, I stuffed that up. I've released a new version.

ccmcbeck commented Jul 9, 2012

Thanks. 0.9.9 works without me having to uncomment the config.extend_classes setting

Hi, I ran into this problem using Rails 4. I saw that active_enum should be compatible, but there seems to be a difference in version 0.9.12 on and that same version here on Github. If I point to the latter directly it all seems to work. If I specify gem 'active_enum', '~> 0.9.12' to fetch from Rubygems I get this error:

Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
  active_enum (~> 0.9.12) ruby depends on
  activesupport (~> 3.0) ruby

rails (>= 4) ruby depends on
  activesupport (4.0.0)

When I point to master I see this in gemfile.lock:

active_enum (0.9.12)
activesupport (>= 3.0)

Which would indeed allow for higher versions of activesupport.

I'm still relatively new to Rails so it could very well be that I'm overlooking something, in that case just remove this comment. Anyway, glad to have active_enum working again, love it.

To anyone coming here from Google, in case the above comments don't make it clear: you can work around this issue by changing gem 'active_enum' in your Gemfile to gem 'active_enum', github: 'adzap/active_enum'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment