You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I solve it with uninstall all bcrypt gem versions with gem uninstall bcrypt and select option 3 (if exist) and uninstall all bcrypt-ruby gem versions with gem uninstall bcrypt-ruby and select option 3 (if exist) then install bcrypt using gem install bcrypt --platform=ruby then add this line gem 'bcrypt', platforms: :ruby to Gemfile, that is it :D.
Reacted by Christopher Figueroa Braff, Monica Szabo, Adam Zolotarev, Rui Trigo, Rakshit Saxena, rohinijadhav92, Bryan Cole, Hector Davila, Marcin Roszak, Pong Cheecharern and 162 more
Reacted by Sanjeev yadav, dhanrajshimpi, 13ogue, Jaspreet Singh, Belo999, kashif ghaffar asim, Jovan Jonic, Nicholas Maestrello Agiz and Vladyslav Butovskyi
Reacted by Dr.Bill, PRANJAL PRAKASH SRIVASTAVA, megraf, stefano, Saher Mahar, Alison R. Wu, sergey-givola, shay nguyen, MateuszJust, Rishabh Indoria and 19 more
Reacted by Saber, Minh Nguyen, Monica Szabo, Marcin Roszak, PRANJAL PRAKASH SRIVASTAVA, megraf, Dyesse YUMBA, P. McPhee, Carlos Lázaro Costa, stefano and 29 more
Reacted by 13ogue, Peter Pavlík, Carlo Fontanos, Olivia, Emanuel Lorenzo, Nicholas Vaden, Tajamal Hussain, Thomas Surgent, minennick, Jovan Jonic and 3 more
Reacted by Saravanabalagi Ramachandran, haroruhomer, Saber, Andre Haikal, Monica Szabo, Christopher Gregorio, alejandrosr7, Bjørnar Hagen, Hamed, Ricardo CF and 57 more
no meu caso, eu desinstalei todas as versões do bcrypt , com gem uninstall bcrypt e seleciona opção 3 (se existir) e desisntalei todas as versões do bcrypt-ruby gem com gem uninstall bcrypt-ruby e seleciona opção 3 (se existir), depois instalei o bcrypt usando gem install bcrypt --platform=ruby e adicionei esta linha gem 'bcrypt', '~> 3.1.7' no Gemfile. Funcionou certinho.
Reacted by Lúcio Ferreira da Silva, Élisson Michael , Ana Karoliny, Paulo Júnior and Vinicius Gati
Reacted by Vinicius Gati
Reacted by Luis Fernando de Oliveira, Ana Karoliny, Paulo Júnior and Vinicius Gati
In my case, I uninstalled all versions of bcrypt, with gem uninstall bcrypt and select option 3 (if it exists), and uninstalled all versions of bcrypt-ruby gem with gem uninstall bcrypt-ruby and select option 3 (if it exists), then I installed bcrypt using gem install bcrypt --platform = ruby and I added this line gem 'bcrypt', '~> 3.1.7' in Gemfile. It worked right.
Reacted by BK
Reacted by Vinicius Gati and BK
Reacted by Shamila Pathirana, Luis Fernando de Oliveira, Osheen Walawedura, Brett Rivers, Mhretaab Berhe Ayenew, taab84, Carlo Fontanos, Élisson Michael , githubsud, MaximVer and 4 more
I also solved this by uninstalling bcrypt and re-installing it using the --platform=ruby parameter, but here follows a command to remove the gems that depend on bcrypt in case anyone runs into the same problem as me (gem Uninstallation aborted due to dependent gem(s)): gem list bcrypt | cut -d" " -f1 | xargs gem uninstall -aIx
Reacted by Jesús Miramontes, Alp Deveci, David Jia, Karol and WatchMeIndogo
As shown in #102 (comment), pointing the gemfile to the git repo seems to be working nowadays. That is, gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
edit Sept 2017: It is probably better to follow #142 (comment) (stonewallthomas, just below me). Is bcrypt-ruby dilapidated?
Reacted by PragmaticEd, Antonio Ossa-Guerra, Paul O'Neill, scwells, Chetan Pangam, Tim A, Nikita Krivousov, Dominic Davies, Renee Gallison, Chuck Williams and 10 more
Reacted by Chuck Williams, Daniel Alves and Артур Кармов
Reacted by Jevon Wright, Daniel Alves, Maksim Loginov and Артур Кармов
Reacted by Jevon Wright, Daniel Alves and Артур Кармов
Gees, thank you so much. I spent over an hour on this yesterday, and this actually worked! I followed so many bogus procedures in different forums. It was this simple for me:
I have Windows 7 64, Ruby 2.3.3, Rails 5.0.2
I did this in terminal in my project root:
gem uninstall bcrypt-ruby
gem uninstall bcrypt
gem install bcrypt --platform=ruby
Then added this to my Gemfile:
gem 'bcrypt', '~> 3.1.11'
And of course:
bundle install
Reacted by Raman Skaskevich, ilentt, Maximiliano Arias, X.kemo_fur, Tim A, Harry Krewson, Brett Rivers, Dominic Davies, Rebecca Scott, Markvin Subida and 29 more
Reacted by David Cotter, Maksim Loginov and Jaqueline Dahmer Steffenon
Reacted by Dominic Davies
Reacted by David Cotter, K0sst1k, Joseph D. Daniel and Jaqueline Dahmer Steffenon
Hi @codahale - since this issue appears to be resolved in master, could you please release an update to rubygems? Looks like the last public release was in 2014
rails s
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in require': cannot load such file -- bcrypt_ext (LoadError) from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in rescue in <top (required)>'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:12:in <top (required)>' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in require'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in block (2 levels) in require' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in block in require' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in require' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler.rb:114:in require'
from C:/Sites/stukdo/config/application.rb:7:in <top (required)>' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in require'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in block in perform' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in tap'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in perform' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in run'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in dispatch'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in perform' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command.rb:44:in invoke'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in <top (required)>' from bin/rails:4:in require'
from bin/rails:4:in `
@johnnyshields I'm no longer involved with RubyInstaller or Ruby for Windows, however the error is caused by the gem lacking binaries for newer versions of Ruby.
While you can manually force to recompile (gem install bcrypt --platform=ruby), Bundler might not be friendly and will always try to install the binary version instead.
@larskanis has helped other projects get better support of newer Rubies on several projects and might be able to provide some up-to-date instructions or pointers on what will be required on your end.
From the get go, this might need a new release of the gem.
Years ago I proposed #117, which would provide updated fat binary Windows gems, but to be honest, it's probably best to drop these platform specific gem versions entirely and release a platform "ruby" gem only at the next version. This always requires to have DevKit installed, but the Ruby+DevKit version is by far the most downloaded RubyInstaller flavor anyways.
This way Windows is no longer treated as a special case, which requires new releases for every new ruby version, but behaves as on all other operating systems.
@tjschuck I tested bcrypt-3.1.12.rc1 successfully on Ruby-2.5.1-x64. However it still fails with cannot load such file -- bcrypt_ext on Ruby-2.6. This is why I think it's better to no longer release fat binary gems.
In my case, I uninstalled all versions of bcrypt, with gem uninstall bcrypt and select option 3 (if it exists), and uninstalled all versions of bcrypt-ruby gem with gem uninstall bcrypt-ruby and select option 3 (if it exists), then I installed bcrypt using gem install bcrypt --platform = ruby and I added this line gem 'bcrypt', '~> 3.1.7' in Gemfile. It worked right.
Activity
AliOsm commentedon Oct 9, 2016
I solve it with uninstall all
bcryptgem versions withgem uninstall bcryptand select option 3 (if exist) and uninstall allbcrypt-rubygem versions withgem uninstall bcrypt-rubyand select option 3 (if exist) then installbcryptusinggem install bcrypt --platform=rubythen add this linegem 'bcrypt', platforms: :rubytoGemfile, that is it :D.naiguelsantos commentedon Jan 27, 2017
no meu caso, eu desinstalei todas as versões do bcrypt , com gem uninstall bcrypt e seleciona opção 3 (se existir) e desisntalei todas as versões do bcrypt-ruby gem com gem uninstall bcrypt-ruby e seleciona opção 3 (se existir), depois instalei o bcrypt usando gem install bcrypt --platform=ruby e adicionei esta linha gem 'bcrypt', '~> 3.1.7' no Gemfile. Funcionou certinho.
naiguelsantos commentedon Jan 27, 2017
In my case, I uninstalled all versions of bcrypt, with gem uninstall bcrypt and select option 3 (if it exists), and uninstalled all versions of bcrypt-ruby gem with gem uninstall bcrypt-ruby and select option 3 (if it exists), then I installed bcrypt using gem install bcrypt --platform = ruby and I added this line gem 'bcrypt', '~> 3.1.7' in Gemfile. It worked right.
rodrigopk commentedon Feb 13, 2017
I also solved this by uninstalling bcrypt and re-installing it using the --platform=ruby parameter, but here follows a command to remove the gems that depend on bcrypt in case anyone runs into the same problem as me (gem Uninstallation aborted due to dependent gem(s)):
gem list bcrypt | cut -d" " -f1 | xargs gem uninstall -aIxsanjeevyadavIT commentedon Feb 23, 2017
Thank you so much finally, something worked, but what was the issue causing it?
pranjal815 commentedon Feb 25, 2017
Thank you so much @AliOsm I finally able to resolve the issue.
michael-wise commentedon Mar 29, 2017
As shown in #102 (comment), pointing the gemfile to the git repo seems to be working nowadays. That is,
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'edit Sept 2017: It is probably better to follow #142 (comment) (stonewallthomas, just below me). Is bcrypt-ruby dilapidated?
stonewallthomas commentedon Apr 4, 2017
Gees, thank you so much. I spent over an hour on this yesterday, and this actually worked! I followed so many bogus procedures in different forums. It was this simple for me:
I have Windows 7 64, Ruby 2.3.3, Rails 5.0.2
I did this in terminal in my project root:
gem uninstall bcrypt-ruby
gem uninstall bcrypt
gem install bcrypt --platform=ruby
Then added this to my Gemfile:
gem 'bcrypt', '~> 3.1.11'
And of course:
bundle install
looeyf commentedon May 3, 2017
@naiguelsantos Thank you man, you saved my life, although I had to delete the Gemfile.lock before running the codes you said, but after all it worked.
busterb commentedon May 13, 2017
Hi @codahale - since this issue appears to be resolved in master, could you please release an update to rubygems? Looks like the last public release was in 2014
TheChisus commentedon May 26, 2017
Tried almost everything here and nada. I stumbled on https://stackoverflow.com/questions/33588735/loaderror-cannot-load-such-file-bcrypt-ext-on-windows-2008-x64-server and the first answer (answer with most votes) solved it!
Adilkemo commentedon Jun 10, 2017
thank you a lot Mr.@stonewallthomas your solutions is work on me
dominiccodes commentedon Jul 1, 2017
Thanks stonewallthomas and gregkin
17 remaining items
wallwood commentedon Apr 21, 2018
This isnt work for me also
rails s
'C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in
require': cannot load such file -- bcrypt_ext (LoadError) from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:inrescue in <top (required)>'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:12:in
<top (required)>' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:inrequire'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in
block (2 levels) in require' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:ineach'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in
block in require' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:ineach'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in
require' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler.rb:114:inrequire'from C:/Sites/stukdo/config/application.rb:7:in
<top (required)>' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:inrequire'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in
block in perform' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:intap'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in
perform' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:inrun'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in
invoke_command' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:indispatch'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in
perform' from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command.rb:44:ininvoke'from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in
<top (required)>' from bin/rails:4:inrequire'from bin/rails:4:in `
johnnyshields commentedon Apr 26, 2018
Bcrypt team, please fix this issue
Use AppVeyor for testing Windows gem installs
johnnyshields commentedon May 10, 2018
@luislavena is this something you could help with?
luislavena commentedon May 10, 2018
@johnnyshields I'm no longer involved with RubyInstaller or Ruby for Windows, however the error is caused by the gem lacking binaries for newer versions of Ruby.
While you can manually force to recompile (
gem install bcrypt --platform=ruby), Bundler might not be friendly and will always try to install the binary version instead.@larskanis has helped other projects get better support of newer Rubies on several projects and might be able to provide some up-to-date instructions or pointers on what will be required on your end.
From the get go, this might need a new release of the gem.
Hope that helps.
Cheers.
johnnyshields commentedon May 10, 2018
@luislavena thank you that's very helpful. @larskanis or someone from this project can you please help?
wallwood commentedon May 10, 2018
Hello,
Its solve for me with step is below :
Done !
johnnyshields commentedon May 10, 2018
@wallwood they need to bundle new binaries with the gem for windows. then these steps won't be needed.
larskanis commentedon May 10, 2018
Thanks @luislavena for the invitation!
As far as I remember bcrypt builds fine with any RubyInstaller version, provided that DevKit is present. So you can either use
or if you're using a Gemfile than
Years ago I proposed #117, which would provide updated fat binary Windows gems, but to be honest, it's probably best to drop these platform specific gem versions entirely and release a platform "ruby" gem only at the next version. This always requires to have DevKit installed, but the Ruby+DevKit version is by far the most downloaded RubyInstaller flavor anyways.
This way Windows is no longer treated as a special case, which requires new releases for every new ruby version, but behaves as on all other operating systems.
johnnyshields commentedon May 10, 2018
I would agree it would be best to drop the platform specific versions, as everyone on windows has devkit. Can a gem maintainer help with this?
tjschuck commentedon May 15, 2018
I have just pushed version 3.1.12.rc1 to RubyGems.org which should solve this problem.
Can someone please confirm that
gem install bcrypt --prereleasenow works on Windows? If so, I'll push out the final version.larskanis commentedon May 16, 2018
@tjschuck I tested bcrypt-3.1.12.rc1 successfully on Ruby-2.5.1-x64. However it still fails with
cannot load such file -- bcrypt_exton Ruby-2.6. This is why I think it's better to no longer release fat binary gems.tjschuck commentedon May 16, 2018
Version 3.1.12 of the bcrypt gem, which should fix this issue, was just pushed to RubyGems.
You should now be able to
gem install bcrypton Windows with none of the above workarounds.Thanks, everyone!
rubyyc commentedon Dec 13, 2018
@cahyowhy 我跟你报一样的错误,请问您最终是如何解决的?
baladkb commentedon May 28, 2019
You saved me!