2012-04-25 174 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'