Getting development error "User does not respond to" development method "when running" rails generate devise: install "

I get a development error "The user does not respond to the" development method "when running" rails generate devise: install ". Ideas how to solve it?

Actually also get this error when trying to run "rails generate devise: install" I just noted.

Notes:

Gregs-MacBook-Pro:testapp greg$ rails generate devise:install /Library/Ruby/Gems/1.8/gems/devise-2.0.1/lib/devise/rails/routes.rb:406:in `raise_no_devise_method_error!': 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' (RuntimeError) from /Library/Ruby/Gems/1.8/gems/devise-2.0.1/lib/devise/rails/routes.rb:207:in `devise_for' from /Library/Ruby/Gems/1.8/gems/devise-2.0.1/lib/devise/rails/routes.rb:203:in `each' from /Library/Ruby/Gems/1.8/gems/devise-2.0.1/lib/devise/rails/routes.rb:203:in `devise_for' from /Users/greg/source_rails/testapp/config/routes.rb:2 from /Library/Ruby/Gems/1.8/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:272:in `instance_exec' from /Library/Ruby/Gems/1.8/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:272:in `eval_block' from /Library/Ruby/Gems/1.8/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:249:in `draw' 

and

 Gregs-MacBook-Pro:testapp greg$ ruby -v **ruby 1.8.7** (2010-01-10 patchlevel 249) [universal-darwin11.0] Gregs-MacBook-Pro:testapp greg$ rails -v **Rails 3.2.1** Gregs-MacBook-Pro:testapp greg$ gem list *** LOCAL GEMS *** actionmailer (3.2.1) actionpack (3.2.1) activemodel (3.2.1) activerecord (3.2.1) activeresource (3.2.1) activesupport (3.2.1) addressable (2.2.6) arel (3.0.0) bcrypt-ruby (3.0.1) builder (3.0.0) bundler (1.0.22) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.2.0) devise (2.0.1) erubis (2.7.0) execjs (1.3.0) faraday (0.7.6) hike (1.2.1) i18n (0.6.0) journey (1.0.1) jquery-rails (2.0.0) json (1.6.5) mail (2.4.1) mime-types (1.17.2) multi_json (1.0.4) multipart-post (1.1.4) mysql (2.8.1) mysql2 (0.3.11) oauth (0.4.5) oauth-plugin (0.4.0.rc2) oauth2 (0.5.2) orm_adapter (0.0.6) polyglot (0.3.3) rack (1.4.1) rack-cache (1.1) rack-ssl (1.3.2) rack-test (0.6.1) rails (3.2.1) railties (3.2.1) rake (0.9.2.2) rdoc (3.12) rubygems-update (1.8.15) sass (3.1.15, 3.1.14) sass-rails (3.2.4) sprockets (2.1.2) sqlite3 (1.3.5) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) tzinfo (0.3.31) uglifier (1.2.3) warden (1.1.0) 
+6
source share
4 answers

It looks like you already have a development method that is called in your user model. Did you already run rails g devise User ?

Comment on this and comment out the line devise_for :users in the routes file, if there is one.

+46
source

The completion of the tutorial for rails, and these answers did not work for me, but after some searches a solution was found. Hope this helps someone else who is new and working on this issue.

  • Go to: config / routes.rb file
  • Comment out the line devise_for :installs (put the hash tag in front)
  • Go to your Ruby terminal and re-enter: rails generate devise:install

Now Devise should be installed correctly, and subsequent errors should disappear.

A source

+3
source

For people arriving here due to the following error:

The user does not respond to the 'devise' method. This usually means that you did not upload your ORM file or downloaded too late. To fix this, be sure to require "devise / orm / YOUR_ORM" inside 'config / initializers / devise.rb' or before defining your application in 'config / application.rb' (RuntimeError)

but you have already correctly initialized ORM, it may be associated with precious stones. I was getting the same problem in an old application and this was due to incompatibility with the active_reload . gem active_reload not compatible with Rails 3.2 and must be removed. active_reload was included in Rails 3.2, so it can be safely removed.

I got a solution from here: http://anlek.com/2012/02/user-does-not-respond-to-devise-method/

+1
source

I had the same problem. however, for me this was caused by a conflict with the active_reload stone. as soon as I deleted, everything was fine. I got a hint from https://github.com/plataformatec/devise/issues/1597

0
source

Source: https://habr.com/ru/post/908247/


All Articles