Rails 3.1: Enumerated_attribute breaks scaffolding (easy fix)
We use and recommend the gem enumerated_attribute when you save ‘types’ (such as workflow states) to your rails application.
However, at least for rails 3.1.3, ruby 1.9.2, and the latest released gem 0.2.16, it breaks rails scaffolding completely, throwing the error:
/Users/devmac/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': no such file to load — rails_generator (LoadError)
The workaround is to
- comment out the gem in your Gemfile,
- save the file (NO need to run bundle install),
- run your scaffold command,
- then un-comment the gem and
- re-save the Gemfile.
Adding -c=scaffold_controller
also needed if using active_admin
As noted in another post, active_admin
seems to break scaffolding unless you add -c=scaffold_controller
to the end of the scaffold command.