我目前遇到2个错误。日志中的一项包括:
[RailsAdmin] Could not load model Clock, assuming model is non existing.
另一个是当我运行测试以访问 rails_admin 时:
wrong number of arguments (2 for 0)
使用 rails 4.2.2 和 ruby 2.2.1
我安装了发条宝石并要求它为假。
gem "clockwork", require: false
我的时钟文件在 lib 文件夹中并且工作正常:
require File.expand_path('../../config/boot', __FILE__)
require File.expand_path('../../config/environment', __FILE__)
require 'clockwork'
include Clockwork
if ENV.fetch("CLOCKWORK_ENABLED", false) == "enabled"
every(1.week, "send reminder warning email", at: "Thursday 06:00", tz: "PST"){
`rake inactive_user_management:reminder_warning_email`
}
end
这是我的 rails_admin 初始化程序。该错误以前发生在 ckeditor 循环中,并说 configure: content, :ck_editor 有 2 for 0 参数。
RailsAdmin.config do |config|
config.authorize_with do
unless current_user.admin?
redirect_to(
main_app.root_path,
alert: I18n.t("rails_admin.not_permitted")
)
end
end
config.current_user_method { current_user }
config.actions do
dashboard # mandatory
index # mandatory
new
export
bulk_delete
show
edit
delete
show_in_app
## With an audit adapter, you can add:
# history_index
# history_show
end
RailsAdmin.config do |config|
config.model Article do
configure :content, :ck_editor
end
end
end
我在 Rails Admin 中遇到错误发生的位置,但不确定如何以正确的方式解决它:https ://github.com/sferik/rails_admin/blob/master/lib/rails_admin/abstract_model.rb#L20
感谢您的任何解决!