mardi 17 octobre 2017

NameError Exception: uninitialized constant BCrypt Rails 5, Windows

I am using Devise with Rails 5 on Windows. I know about the problem with Windows and BCrypt and I am following the instructions from internet to make it work:

  1. uninstall all bcrypt gem versions with gem uninstall bcrypt and select option 3 (if exist);
  2. gem uninstall bcrypt-ruby and select option 3 (if exist);
  3. install bcrypt using gem install bcrypt --platform=ruby;
  4. add this line gem 'bcrypt', platforms: :ruby to Gemfile.

And I thinks it works, because Devise depends on BCrypt and Devise works fine.

The problem is when I use Byebug and use in the console BCrypt, I am getting an error:

NameError Exception: uninitialized constant Auth::AuthController::BCrypt

For the exaample if I type: BCrypt::Engine.generate_salt I am getting the error.

Aucun commentaire:

Enregistrer un commentaire