LoadError in Devise::SessionsController#create -- cannot load such file -- bcrypt_ext

I am getting the following error and I have no idea what to do.

I have tried all the available solutions on internet but I cannot get rid of this problem. I am attaching the screen shot of the error.

enter image description here

I am using mysql2, rails version is "Rails 5.0.1" and ruby version is "ruby 2.3.3p222".

Upvotes: 1

Views: 2092

Answers (4)

vidur punj
vidur punj

Reputation: 5901

Try adding below gems in the gemfile would resolve the issue:

gem 'bcrypt', platforms: :ruby # to resolve the cannot load such file -- sassc
gem "sassc-rails" # to resolve the cannot load such file -- sassc

Then:

 bundle install
 rails s

Upvotes: 1

Oktay Ergun
Oktay Ergun

Reputation: 1

https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions

run cmd with adminstrator priveleges and paste this.

npm install --global --production windows-build-tools

after you install windows build tools, you can use bcrypt without any problem.

Upvotes: 0

Ashish.S
Ashish.S

Reputation: 41

Try running:

  1. gem uninstall bcrypt-ruby

  2. In your gemfile, add

    gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
    
  3. bundle install

This works on Windows 10 64bit.

Upvotes: 1

I solve the above issue by typing following commands:

gem uninstall bcrypt-ruby

after that we need to reinstall

gem install bcrypt --platform=ruby

now we need to add below code in the gem file

gem 'bcrypt', platforms: :ruby

by performing above steps bcrypt issue is resolved.

Upvotes: 3

Related Questions