I ran the rails by creating a development MODEL before the rails create devise: install

I accidentally added my Devise model before starting the source generator.

First I ran the code:

$ rails generate devise MODEL 

Initial settings generator (what I should have run first):

 $ rails generate devise:install 

I now have a developed controller called "Model" that will not allow me to run "rake db: migrate"

Mistake:

 rake aborted! User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb' /Users/andyHuynh/.rvm/gems/ruby-1.9.3-p327/gems/devise-2.2.3/lib/devise/rails/routes.rb:443:in `raise_no_devise_method_error!' /Users/andyHuynh/.rvm/gems/ruby-1.9.3-p327/gems/devise-2.2.3/lib/devise/rails/routes.rb:211:in `block in devise_for' /Users/andyHuynh/.rvm/gems/ruby-1.9.3-p327/gems/devise-2.2.3/lib/devise/rails/routes.rb:207:in `each' /Users/andyHuynh/.rvm/gems/ruby-1.9.3-p327/gems/devise-2.2.3/lib/devise/rails/routes.rb:207:in `devise_for' /Users/andyHuynh/Code/jargon/config/routes.rb:3:in `block in <top (required)>' /Users/andyHuynh/.rvm/gems/ ruby-1.9.3-p327@global /gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec' /Users/andyHuynh/.rvm/gems/ ruby-1.9.3-p327@global /gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `eval_block' /Users/andyHuynh/.rvm/gems/ ruby-1.9.3-p327@global /gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:260:in `draw' /Users/andyHuynh/Code/jargon/config/routes.rb:1:in `<top (required)>' ... 

Is there a way to cancel this process to start the first generator? I am using Rails 3.2.12. Any help is appreciated. Thanks

+7
source share
2 answers

You can cancel the generation commands with rails destroy ... , so in your case it will be:

 $ rails destroy devise MODEL 

If this does not work for any reason, you can simply delete the model and migration - these are just files.

+19
source

rails destroy model solution: user or rails destroy scaffold: user

+3
source

All Articles