我正在尝试将 devise_token_auth 与 active_admin 一起使用。运行时rails g active_admin:install User
出现以下错误。
错误
usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:578:in
add_route': Invalid route name, already in use: 'new_user_session' You may have defined two routes with the same name using the
:as` 选项,或者您可能会覆盖已定义的路由具有相同命名的资源。
路线.rb
Rails.application.routes.draw do
devise_for :users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
mount_devise_token_auth_for 'User', at: 'auth'
scope module: 'api' do
namespace :v1 do
resources :users, only: [:index, :show]
end
end
get '/docs' => redirect('/swagger/dist/index.html?url=/apidocs/api-docs.json')
end