Ruby on rails rake测试:profile给出错误
我正在尝试对我的应用程序进行一些测试。基于此指南 我运行这样的命令rake test:profile和rake test:benchmark 这两次我都犯了这样的错误:Ruby on rails rake测试:profile给出错误,ruby-on-rails,ruby,testing,Ruby On Rails,Ruby,Testing,我正在尝试对我的应用程序进行一些测试。基于此指南 我运行这样的命令rake test:profile和rake test:benchmark 这两次我都犯了这样的错误: DEPRECATION WARNING: ActionDispatch::ShowExceptions.rescue_responses is deprecated. Please configure your exceptio application config instead. (called from <top (
DEPRECATION WARNING: ActionDispatch::ShowExceptions.rescue_responses is deprecated. Please configure your exceptio application config instead. (called from <top (required)> at /home3/ecotec11/rails_apps/darbs/config/environment.
/home3/ecotec11/rails_apps/darbs/app/models/admin.rb:1:in `<top (required)>': Admin is not a class (TypeError)
弃用警告:ActionDispatch::ShowExceptions.rescue\u响应已弃用。请改为配置例外应用程序配置。(从at/home3/ecotec11/rails\u apps/darbs/config/environment调用。
/home3/ecotec11/rails\u apps/darbs/app/models/admin.rb:1:in`:admin不是一个类(TypeError)
Admin.rb
class Admin < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me
end
class Admin
有人有主意可以帮我吗?谢谢你可能有
class Admin < ActiveRecord::Base
class Admin
行作为
admin.rb
文件中的第一行。但是您可能在应用程序的其他地方定义了名为admin
的常量。更改此常量的名称。显示您的admin.rb
文件。@MarekLipka更新了我的QI,我正在使用活动管理gem,管理的某些部分在哪里使用。这是问题吗?不太可能。我会y在初始化器中查找Admin
定义。在那里我可以找到ActiveAdmin文件,但不只是Admin。它不是关于文件,而是关于常量定义。类似于源代码中的Admin='Something'
。我搜索了初始化器文件夹中的所有内容,没有找到任何管理常量。还有其他方法可以找到t他一直在我的项目中工作?