Search code examples
ruby-on-railsrubywindows-10bcrypt-rubyrails-5.1.6

Loading error:bcrypt


I have created a admin panel using ROR platform. Now whenever I try to login I'm getting this error :

Cannot load such file bcrypt_ext

I have come across this error in the past but used to rectify it by uninstalling and reinstalling it using the below steps:

  1. shut down all rails servers
  2. uninstall all versions of bcrypt
  3. manually install v3.1.1 (gem install bcrypt --platform=ruby)
  4. update gem files of projects

But this time nothing works. I have referred many links but none helped.

i'am working using Windows 10, Rails 5.1.6 and Ruby 2.3.3.

i have used devise gem for login function and my user model looks like this

class User < ApplicationRecord
 devise :database_authenticatable,#, :registerable,
     :recoverable, :rememberable, :trackable, :validatable 
 end 

admin.controller

class AdminController < ActionController::Base
 protect_from_forgery with: :exception
 before_action :authenticate_user!
end

Solution

  • The gem's version you're trying to install might not be available yet on Windows. Have you tried installing a previous version of bcrypt? Or take a look at https://github.com/codahale/bcrypt-ruby/issues/139, multiple solutions are provided.