Devise is a great gem! It really helps you, taking all authentication jobs away from you. However, upgrading Devise up to version 3.x can be a little bit tricky. In this post I’ll show you how to do that.
First of all, update your gem via bundle update OR specify version in your Gemfile:
And run bundle install.
Since devise 3.1 platformatec announced few security improvements. One of them is secret_key. To add it open devise config and add:
# The secret key used by Devise. Devise uses this key to generate# random tokens. Changing this key will render invalid all existing# confirmation, reset password and unlock tokens in the database.config.secret_key='2710f15f11771d6692a3015d7e3dba2cb05539c1f72i6u345df5433hg535kj5x56v6er56if2566c63c2ad670d6859e536b40d87e6543b115609f0464bdd99502abbe241c4'
Of course, you should use your own secret key, so change my example to be more secure.
If you have ever generated devise’s views, then you should change it’s mailers to use @token instead of @resource.*_token: