Ruby 2.2.2 on Windows - LoadError: cannot load such file -- bcrypt_ext #128
Copy link
Copy link
Closed
Description
May be it is related to #126 as well.
When I try to require bcrypt:
irb(main):001:0> require 'bcrypt'
LoadError: cannot load such file -- bcrypt_ext
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x64-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x64-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from (irb):1
from C:/Ruby22-x64/bin/irb:11:in `<main>'
it fails.
Reproduced at:
- Windows 7 x64
- Ruby ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]
- bcrypt (3.1.10 x64-mingw32)
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
richpeck commentedon Nov 16, 2015
http://stackoverflow.com/a/33593911/1143732
belgoros commentedon Nov 16, 2015
Even the downgrading to
bcrypt (3.1.9 x64-mingw32)does not solve the issue :(. I suppose, the only solution would be to dowwgrade Ruby to2.1.5? FYI, there is alreadyRuby 2.2.3 Windows installeravailable.galaydaroman commentedon Nov 16, 2015
Try to install missed lib
sudo apt-get install libgmp-dev libgmp3-devbelgoros commentedon Nov 17, 2015
@galaydaroman: as I mentioned in the issue title, it was reproduced on a Windows PC😀
genivalvb commentedon Dec 9, 2015
Hello people,
I have with same error.
I installed devise, but happened the error when I try to do login.
bcrypt_ext load error
I did tried with bcrypt-ruby require bcrypt -> not work.
I did tried with bcrypt 3.1..7 and 3.1.9 and 3.1.10 -> not work.
I tried with many other ways, but not solved.
I used ruby 2.2.3 and rails 4.1.5, there are a way to workaround this?, I need the devise work with theses versions.
Thank you so advance,
genivalvb commentedon Dec 9, 2015
I am using Windows 7 and Ubuntu 15.10, but I need that this work in Windows 7 64 bits, with ruby 32bits running.
Require a version of bcrypt that works on Windows when needed
dacochan commentedon Jan 5, 2016
Iam use this,
gem 'bcrypt-ruby', '3.1.1.rc1', :require => 'bcrypt'
hut8 commentedon Jan 7, 2016
@dacochan doesn't seem to work. Windows 10 64 bit running Ruby 2.2.2
arnaskro commentedon Jan 20, 2016
Hello, here is my solution:
bcryptandbcrypt-rubyby running these two commands:gem uninstall bcryptandgem uninstall bcrypt-rubygem install bcrypt --platform=rubygem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt'bundle installI have Windows 10 64 bit running Ruby 2.2.2
hut8 commentedon Jan 20, 2016
I should have updated my comment before after I replied to the aforementioned post on stackoverflow. I'm not sure why (and don't have time right now to figure it out), but to fix it, I did:
I used this answer, but then
make installput the resulting.sofile in C:\Ruby22\lib\ruby\site_ruby\2.2.0\i386-msvcrt. The gem was not looking there for it, according the error message. So, I copied that manually toC:\Ruby22\lib\ruby\gems\2.2.0\gems\bcrypt-ruby-3.1.1.rc1-x86-mingw32\liband it worked fine.cyaafi commentedon Jan 21, 2016
Thanks so much you save me from giving up
Sent from my T-Mobile 4G LTE Device
I have Windows 10 64 bit running Ruby 2.2.2
Reply to this email directly or view it on GitHub:
#128 (comment)
cyaafi commentedon Jan 21, 2016
Also can you show me how to install ImageMagick and paperclip.
Sent from my T-Mobile 4G LTE Device
I have Windows 10 64 bit running Ruby 2.2.2
Reply to this email directly or view it on GitHub:
#128 (comment)
zrisher commentedon Jan 23, 2016
+1, please fix the distributed version to build automatically.
Temporary solution for me was to uninstall all local bcrypt versions and reinstall using the MRI version with
gem install bcrypt --platform=ruby, similar to arnaskro's comment.jnslxndr commentedon Jan 25, 2016
+1 for a fix!
21 remaining items
dimanyc commentedon Mar 31, 2016
@tjschuck yep, 3.1.1 works like a charm. Thanks!
zrisher commentedon Mar 31, 2016
Confirmed working for me as well, thank you!
jostster commentedon Sep 15, 2016
@tjschuck I'm having this same issue with just having
bcrypt (3.1.11 x64-mingw32)installed with Ruby 2.3.1Just a little update I have to uninstall all bcrypt and then manually install it from the command line with
gem install bcrypt --platform=ruby. If I try and use thebundle installwithgem 'bcrypt', platforms: :rubyit installs bcrypt with versions in the lib but it doesn't include 2.3.rbcarlos commentedon Oct 22, 2016
@artdias90 Thank you! You helped a lot. None of other workarounds didn't work for me.
DouglasAllen commentedon Oct 25, 2016
Just a quick reminder for us Windows folk.
C:\Users>devkitvars
be sure you have that on the path.
DouglasAllen commentedon Oct 25, 2016
The issue I have should be with datamapper.
The dm-types depends upon bcrypt-ruby (~> 3.0)
but because I have a preinstalled bcrypt-ruby (3.1.5-x64-mingw32)
that relies on bcrypt (>= 3.1.3)
and I get a message after 'bundle install'
Post-install message from bcrypt-ruby:
#######################################################
The bcrypt-ruby gem has changed its name to just bcrypt. Instead of
installing
bcrypt-ruby, you should installbcrypt. Please update yourdependencies accordingly.
#######################################################
Why should I go in and try to correct datamapper?
Tell them or suggest it. This is a rack app and it is getting like rails used to be.
Sorry! Didn't mean to rant. But I'm confused.
acrolink commentedon Nov 30, 2016
@artdias90 Thank you very much.
FollyHermann commentedon Feb 10, 2017
hello there
big up to you @artdias90
I have just tried your solution and it is working perfect.
Thank for sharing.
Rappole4 commentedon Feb 28, 2017
Windows won't allow the uninstall bcrypt, says:
ERROR: While executing gem ... (Gem::DependencyRemovalException)
Uninstallation aborted due to dependent gem(s)
still get same load issue :
cannot load such file -- bcrypt_ext
tried above suggestions, and others?
zrisher commentedon Mar 28, 2017
Confirmed this problem has reappeared for me with
bcrypt (3.1.11 x64-mingw32),ruby 2.3.3, and Windows 10. Previous fix ofgem uninstall bcrypt,gem install bcrypt --platform=rubystill works.AnwarShah commentedon Apr 30, 2017
Only @marcomd's solution of compiling the gem worked.
dharmesh-khandelwal commentedon May 5, 2017
@marcomd You saved me! Compiling bcrypt worked in windows 10. Just had to change bcrypt version to 3.1.11.
Gary336 commentedon Jun 2, 2017
I can confirm that
gem uninstall bcryptfollowed bygem install bcrypt --platform=rubyworked for me today on Windows 10 64 bit.Gary336 commentedon Jul 7, 2017
baladkb commentedon Jun 3, 2019
thanks!