I'm using has_secure_password in a new application and it works great locally. However, when I deploy to our server and try to run it I get the following error message:
undefined local variable or method `has_secure_password' for WorkerLogin:Class
I did a bundle install and everything so I'm not sure what's missing. I'm on ruby 1.9.2p290 but I don't think that would be the problem.
Thoughts?
I eventually realized I didn't have my latest code pushed to GitHub yet when I did the Capistrano deployment. I had include ActiveModel::SecurePassword added to my WorkerLogin class but not checked in. This line is required because I'm using MongoDB/MongoMapper and it doesn't automatically include ActiveModel::SecurePassword like ActiveRecord does.
In Gemfile uncomment or add this line:
gem 'bcrypt-ruby', '~> 3.0.0'
and run bundle install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With