0

I'm having problems with bcrypt when either trying to start my rails server or attempting to login on the localhost.

I have played around by re-downloading/updating my Gem file with different versions of bcrypt and moving files around as per some of the github issues raised around this.

At the moment, my rails server starts, and when I login I get the error:

cannot load such file — 2.3/bcrypt_ext

And my Gem file has: gem 'bcrypt-ruby', '~> 3.0.0'

Any thoughts to get this working consistently on Windows?

Imran Ali
  • 2,223
  • 2
  • 28
  • 41
daveGeo
  • 323
  • 1
  • 3
  • 9
  • Possible duplicate of http://stackoverflow.com/questions/29293321/ruby-on-windows-causes-error-cannot-load-such-file-bcrypt-ext/33593911#33593911 – DroidNoob Feb 03 '17 at 05:10

2 Answers2

2

Came across this github issue and the following seems to work

  1. Firstly uninstall bcrypt and bcrypt-ruby by running these two commands:
    gem uninstall bcrypt and gem uninstall bcrypt-ruby
  2. Install it again with gem install bcrypt --platform=ruby
  3. In your Gemfile write gem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt'
  4. Run bundle install
Tony Vincent
  • 13,354
  • 7
  • 49
  • 68
  • 2
    I tried running those commands in that exact order. When I tried starting my rails server, I get the following error: `C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require': cannot load such file -- bcrypt_ext (LoadError)` – daveGeo Feb 04 '17 at 05:52
0

Okay I got this working by referring to the following answer: https://stackoverflow.com/a/33593911/6676900

The key steps are as follows: 1. Install Devkit from - http://rubyinstaller.org/downloads/ (NOTE: I had to use the 32 bit version even though I am running Windows 10 64 Bit) 2. Update my PATH variable to use the 32bit version of the Dev kit. i.e. %DEVKIT_HOME%\bin (Where %DEVKIT_HOME% is the location of the extracted Dev Kit) 3. Follow the commands in the following answer: https://stackoverflow.com/a/33593911/6676900

Good to go!

Community
  • 1
  • 1
daveGeo
  • 323
  • 1
  • 3
  • 9