I got a bcrypt error when using Devise on Windows 10 and Ruby 2.2.2p95 and rails 4.2.5
You should have DevKit installed and configured correctly to recompile the gem.
1 |
LoadError: cannot load such file -- bcrypt_ext |
Firt stop your server and remove every bcrypt gem or bcrypt-ruby gem.
1 2 3 4 5 6 7 8 9 |
C:\>gem uninstall bcrypt You have requested to uninstall the gem: bcrypt-3.1.10-x86-mingw32 bcrypt-ruby-3.1.5 depends on bcrypt (>= 3.1.3) devise-3.5.2 depends on bcrypt (~> 3.0) If you remove this gem, these dependencies will not be met. Continue with Uninstall? [yN] y Successfully uninstalled bcrypt-3.1.10-x86-mingw32 |
Don’t forget to include bcrypt in your Gemfile
1 |
gem 'bcrypt' |
make a bundle update and recompile the gem like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
C:\<Ruby Path>\lib\ruby\gems\bcrypt-3.1.10-x86-mingw32\ext\mri> ruby extconf.rb C:\<Ruby Path>\lib\ruby\gems\bcrypt-3.1.10-x86-mingw32\ext\mri> make generating bcrypt_ext-i386-mingw32.def compiling bcrypt_ext.c compiling crypt.c compiling crypt_blowfish.c compiling crypt_gensalt.c compiling wrapper.c linking shared-object bcrypt_ext.so (if make is not recognized as a valid command, execute this command and do a make again C:\<Current Folder> C:\<DevKit Path>\devkitvars.bat Adding the DevKit to PATH...) C:\<Ruby Path>\lib\ruby\gems\bcrypt-3.1.10-x86-mingw32\ext\mri> make install /usr/bin/install -c -m 0755 bcrypt_ext.so /C/<Ruby Path>/lib/ruby/site_ruby/2.2.0/i386-msvcrt |
Restart your server.
It should do the trick !
Awesome, at least a solution that actually worked out.
Thank’s a lot for this!!
i cant do make for some reason im in the right the path but the make command doesnt work
it says it has no target
thanks.it worked.
Works like a charm thanks a whole lot. Page Bookmarked
For bcrypt + bitnami
1) cd C:\Bitnami\rubystack-2.3.6-1\ruby\lib\ruby\gems\2.3.0\gems\bcrypt-3.1.11-x86-mingw32\ext\mri
2) load bitnami environment using below command
CALL “C:\Bitnami\rubystack-2.3.6-1\scripts\setenv.bat” (edited)
3) ruby extconf.rb
4) C:\Bitnami\rubystack-2.3.6-1\DevKit\devkitvars.bat
5)make install