每当我重新加载rails服务器或rails控制台时,我都会遇到以下虚假错误。
如果我不动态编辑导致rails服务器重新加载的代码,或者如果我没有触发重新加载,那么一切正常!在rails console上手动命令。
任何想法都将受到最高的赞赏!
2.1.5 :006 > reload!
Reloading...
RuntimeError: User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's 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'
from /Users/v/.rvm/gems/ruby-2.1.5@Googl/gems/devise-3.5.1/lib/devise/rails/routes.rb:490:in `raise_no_devise_method_error!'
from /Users/v/.rvm/gems/ruby-2.1.5@Googl/gems/devise-3.5.1/lib/devise/rails/routes.rb:227:in `block in devise_for'
from /Users/v/.rvm/gems/ruby-2.1.5@Googl/gems/devise-3.5.1/lib/devise/rails/routes.rb:223:in `each'
from /Users/v/.rvm/gems/ruby-2.1.5@Googl/gems/devise-3.5.1/lib/devise/rails/routes.rb:223:in `devise_for'
from /Users/v/workspace/Googl/config/routes.rb:5:in `block in <top (required)>'
为了防止杂乱, application.rb / user model file可以在这里找到:https://gist.github.com/anonymous/bd024a796264d638f755