Trying to run ruby on my Windows 7 machine whenever i go to rails s or rake db:migrate i get the following error Cannot load such file bcrypt_ext.
My ruby version is 2.2.1 my rails version is 4.2.0 and the bcrypt version is 3.1.10. All the gems install correctly when i run bundle install however whenever i try to rake it gives me that error. Any help would be greatly appreciated
You need to use what it says here: https://www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x
C:\> gem install --no-ri --no-rdoc bcrypt
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
I meet the same problem in Window 8.1 64bit , Ruby 2.3.3 64bit , Rails 4.2.10.
My quick solution :
Step 1 : Remove all bcrypt in gem : gem uninstall bcrypt
( choose option 3 if existed (remove all))
Step 2 : Install bcrypt again : gem install bcrypt
Then check version of bcrypt : gem list bcrypt
Step 3 : In Gemfile of your project, add : gem 'bcrypt', '3.1.11', platforms: [:ruby, :x64_mingw]
notice : change the suitable version of your bcrypt (my version : 3.1.11)
Step 4 : Run command in the path of your project : bundle install
Step 5 : Remove the unneeded bcrypt :
Run command : gem uninstall bcrypt
You can see some version of bcrypt , you should keep one version : bcrypt-[your-version] . (Remove all version : bcrypt-[your-version]-x64-mingw32 . In mycase , remove : bcrypt-3.1.11-x64-mingw32)
Restart Rails sever , done
I think this proplem because when we install bcrypt , we didn't specify 64bit or 32bit , it is not compatible with window or ruby ( 64bit or 32bit )
For Windows 10, bcrypt 3.1.11 now works, checked in 24144
steps:
gem install bcrypt -v '3.1.11'
)current versions
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.10586 N/A Build 10586
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With