NoMethodError:Devise:Module的未定义方法“ setup”

时间:2019-04-02 04:48:06

标签: ruby-on-rails ruby-on-rails-3 devise

环境

  • Ruby [1.9.3p547]
  • 导轨 [3.2.22.5]
  • Devise [3.0.4]

当前行为

当我尝试运行任何rake或rails命令时,我将遇到错误

  

耙子中止了!

     

NoMethodError:未定义的方法setup' for Devise:Module /home/tatva/sites/Quotiful-API-master/config/initializers/devise.rb:3:in'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in load' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in in load in'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in load_dependency' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in load'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/engine.rb:593:in block (2 levels) in <class:Engine>' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in in'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in block in <class:Engine>' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in instance_exec'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in run' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/initializable.rb:55:in中的run_initializers块   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in each' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in run_initializers'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/application.rb:136:in initialize!' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/railtie/configurable.rb:30:in method_missing'   /home/tatva/sites/Quotiful-API-master/config/environment.rb:5:in <top (required)>' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in require'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in block in require' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in load_dependency'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in require' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/application.rb:103:in require_environment!'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/railties-3.2.22.5/lib/rails/application.rb:305:in block (2 levels) in initialize_tasks' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/gems/rake-12.2.1/exe/rake:27:in'   /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/bin/ruby_executable_hooks:24:in eval' /home/tatva/.rvm/gems/ruby-1.9.3-p547@quotiful/bin/ruby_executable_hooks:24:in'   任务:TOP => db:migrate =>环境   (通过使用--trace运行任务来查看完整跟踪)

预期行为

为什么我遇到此错误。这个版本是设计的吗?我不想升级devise版本,因为它将影响整个项目。

请帮助我解决此问题。预先感谢。

0 个答案:

没有答案