activeadmin管理员帐户无法访问

时间:2012-04-25 16:29:11

标签: ruby-on-rails activeadmin

我尝试了rake db:reset,现在我可以;访问admin@example.com |密码,它在我登录时返回一个无效的用户/密码。我检查了我的数据库,为什么会这样?

id          email              encrypted_password                                            reset_password_token  reset_password_sent_at  remember_created_at         sign_in_count  current_sign_in_at          last_sign_in_at             current_sign_in_ip  last_sign_in_ip  created_at                  updated_at                
----------  -----------------  ------------------------------------------------------------  --------------------  ----------------------  --------------------------  -------------  --------------------------  --------------------------  ------------------  ---------------  --------------------------  --------------------------
1           admin@example.com  $2a$10$cCUYBOKQHAZhpYgdLIZIWuQArkrsjpgIMu9/kk17127Oj.DKYwVxa                                                2012-04-19 15:23:02.857402  36             2012-04-25 02:37:36.689711  2012-04-25 02:31:55.088037  127.0.0.1           127.0.0.1        2012-03-09 16:23:58.779104  2012-04-25 02:37:36.692613
sqlite> 

2 个答案:

答案 0 :(得分:14)

DO

$ rails console
>> AdminUser.create :email => 'admin@example.com', :password => 'password', :password_confirmation => 'password'

答案 1 :(得分:5)

我遇到了同样的问题,我通过以下方式解决了这个问题:

rake db:drop:all
rake db:create:all
rake db:migrate

我能够重新登录!

假设您不介意完全重置所有内容!