RoR 使用 Devise - 加密密码 [英] RoR using Devise - Encrypted Password
问题描述
请原谅我的无知,但我是 RoR 的新手.我的问题是我试图让我的设计 gem 工作,但是当我填写信息并点击注册时,我得到了这个回报:未定义的方法`encrypted_password=' for".
Hi pardon my ignorance but I'm new to RoR. My problem is that I'm trying to make my Devise gem work but when I fill out the information and click Sign-Up, I get this in return: "undefined method `encrypted_password=' for".
我已经尝试过 rake db:migrate 并清除 User.rb 模型中的属性,但仍然不起作用.
I've already tried rake db:migrate and also clearing the attributes in the User.rb model but still it doesn't work.
请任何指导将不胜感激!
Please any guidance would be appreciated!
推荐答案
这很可能意味着您缺少迁移.您确定,您的设置正确吗?
This most likely means, that you are missing on migrations. Are you sure, that you have setup devise right?
https://github.com/plataformatec/devise
rails generate devise:install
rails generate devise User
bundle exec rake db:migrate
这篇关于RoR 使用 Devise - 加密密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!