bcrypt-ruby

Updating password with BCrypt

半世苍凉 提交于 2019-12-11 04:49:57
问题 When I login with a username and password by BCrypt checks no problem, everything is fine. But when I go through the process of recovering password and try to login with the new password the BCrypt never returns true. The code I have is as follows: before_save :encrypt_password before_update :encrypt_password def authenticate player = Player.find_by(mail: self.mail) unless player.nil? current_password = BCrypt::Password.new(player.password) if current_password == self.password player else nil

bcrypt-ruby - You don't have bcrypt-ruby installed in your application

妖精的绣舞 提交于 2019-12-02 04:40:54
I'm beginner in Ruby on Rails and trying to learn from http://ruby.railstutorial.org/ I'm creating sample_app and got stuck at chapter 6. My Ruby version: ruby 2.0.0p195 (2013-05-14) [i386-mingw32] My Rails version: Rails 4.0.0 I have following line in my GemFile: gem 'bcrypt-ruby', '~> 3.0.0' If I type gem list bcrypt-ruby , it shows bcrypt-ruby (3.0.1) . But if I try to create user, I get error saying You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install I searched a lot on rails website, bcrypt website & even stackoverflow. But,

can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 13:39:15
I have Rails 4.0.0 app. When I run bundle install command there is no problem. This is my GemFile. source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.0' gem 'mysql2' # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0.rc2' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', '~> 4.0.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript

can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile

余生长醉 提交于 2019-11-26 16:28:55
问题 I have Rails 4.0.0 app. When I run bundle install command there is no problem. This is my GemFile. source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.0' gem 'mysql2' # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0.rc2' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', '~> 4.0.0' # See https://github.com/sstephenson/execjs#readme