active admin gem error

ActiveAdmin::DatabaseHitDuringLoad: Your file, app/models/receptionist.rb (line 3),
caused a database error while Active Admin was loading. This is most common when
your database is missing or doesn't have the latest migrations applied. To prevent this
error, move the code to a place where it will only be run when a page is rendered.
Original error message: PG::UndefinedTable: ERROR: relation "admin_users" does
not exist

把routes.rb下的
ActiveAdmin.routes(self) 改为
ActiveAdmin.routes(self) rescue ActiveAdmin::DatabaseHitDuringLoad

posted @ 2017-09-11 12:04  chzhzh  阅读(224)  评论(0编辑  收藏  举报