【发布时间】:2019-07-22 09:10:19
【问题描述】:
我一定是在某些方面搞砸了我的 api。我现在收到以下错误消息:
ArgumentError - Api::V2 的副本已从模块中删除 树,但仍处于活动状态!:
我不确定如何解决这个问题。我的一些 Api 控制器如下所示:
class Api::V2::UsersController < ApplicationController
但以前是这样的:
module Api
module V2
class Api::V2::UsersController < ApplicationController
什么是正确的格式,我该如何解决这个问题?谢谢。
编辑:
.../active_support/dependencies.rb:457: warning: already initialized constant Api
.../active_support/dependencies.rb:457: warning: previous definition of Api was here
LoadError - Unable to autoload constant Api::UsersController, expected .../app/controllers/api/users_controller.rb to define it:
我也有 api/users_controller.rb 和 api/v2/users_controller.rb 两者似乎都有同样的问题。
【问题讨论】:
-
你重启了你的服务器/控制台和Spring
-
请说明您现在遇到了什么错误:
ArgumentError或LoadError或两者兼而有之?
标签: ruby-on-rails ruby api activesupport