2012-04-25 176 views
4

我试图rake db:reset,现在我可以;吨访问它时,在即时通讯记录我检查我的数据库是在那里为什么会这样它返回一个无效的用户名/密码[email protected]|password。 ?activeadmin管理员帐户访问斜面

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   [email protected] $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> 
+0

为什么不只是重设密码? – Sean 2012-04-25 20:19:32

回答

5

我有同样的问题,我解决它通过执行以下操作:

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

,我能够在重新登录!

那假设你不会介意做的一切完全复位!

+0

将耙分贝:复位做到以上的? – 2015-05-07 22:35:42

+0

这可能帮助:http://jacopretorius.net/2014/02/all-rails-db-rake-tasks-and-what-they-do.html – 2015-05-08 03:25:30

14

$ rails console 
>> AdminUser.create :email => '[email protected]', :password => 'password', :password_confirmation => 'password'