我目前收到两个错误。日志中的日志包括:
[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,并要求它为false。
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
感谢您的任何解决方案!
发布于 2015-08-10 10:08:27
尝试在field下定义ckeditor,而不是configure。类似于:
config.model 'Article' do
edit do
field :content do
ckeditor do
true
end
end
end
end因为Clock不是ActiveRecord模型,所以另一个错误听起来是合法的。我猜rails_admin会忽略Clock模型的负载继续渲染。
发布于 2015-08-11 07:00:57
我将clock.rb移到根文件夹中,更新了应用程序所需的文件路径,并针对时钟.rb的新位置更新了procfile。
它解决了这个问题。
https://stackoverflow.com/questions/31907865
复制相似问题