我正在编写一个完整的引擎,其中包括遵循本指南的设计。但是,该指南基于可安装的引擎,而不是完整的引擎,我认为这可能是导致以下错误的原因:
RuntimeError: Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x007f843d9518e8
路线.rb
Rails.application.routes.draw do
# Some other stuff
devise_for :users, {
class_name: 'User',
module: :devise
}, controllers: {
registrations: 'users/registrations',
sessions: 'users/sessions',
passwords: 'users/passwords'
}
end
初始化程序/devise.rb
Devise.setup do |config|
config.router_name = :user
config.secret_key = 'secret_key'
end
lib/my_engine/engine.rb
module MyEngine
class Engine < ::Rails::Engine
require "devise"
end
end