简体   繁体   中英

RoR using Devise - Encrypted Password

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".

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

In the rails console run, this will tell you if the migration has run

User.new.respond_to?(:encrypted_password=)

This should return true, if not do

bundle exec rake db:migrate:reset

In the site railscasts.com you can watch:

http://railscasts.com/episodes/209-introducing-devise

after that you understand where you make a mistake If you then get an error - write comments and we help

PS gem 'devise', '1.1.rc0' => gem 'devise' in gemfile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM