我正在尝试在 Rails 4 下安装 ActiveAdmin 以生成我的管理面板。
我添加了 gem 并使用以下命令安装:
gem 'activeadmin', github: 'gregbell/active_admin'
bundle install
rails g active_admin:install # creates the AdminUser class
rails g active_admin:install User # uses an existing class
但是当我尝试迁移时出现错误:
$ rake db:migrate
== AddDeviseToAdminUsers: migrating ==========================================
-- change_table(:admin_users)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: duplicate column name: email: ALTER TABLE "admin_users" ADD "email" varchar(255) DEFAULT '' NOT NULL/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `initialize'
如github 上的 issue 753中所述,我将AddDeviseToAdminUsers
迁移从更改change_table
为 ,create_table
但这会导致此错误:
== AddDeviseToAdminUsers: migrating ==========================================
-- create_table(:admin_users)
rake aborted!
有人可以帮忙吗?