FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bcrypt 3.1.11 - Cannot load file on Windows · Issue #142 · bcrypt-ruby/bcrypt-ruby · GitHub

Repository navigation

Bcrypt 3.1.11 - Cannot load file on Windows #142

Description

Bcrypt stoped working for everything i am using in my app, in my case gems like Devise are dependant of bcrypt, and them are not working anymore.

For the purpose of showing the error to you, i just create a new app named test-a, uncomment the Gemfile line

gem 'bcrypt', '~> 3.1.7'

Then run command

bundle install

And trying to start the server

rails s

It explodes bad time! With the error

C:/Ruby23/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)

This is the screenshot

I am using the next:

  • Windows 10 64-bit
  • Rails 5.0.0.1
  • ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]

Hope there is some fix for this issue soon.

Activity

  1. AliOsm commented on Oct 9, 2016

    Author

    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.

  2. naiguelsantos commented on 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.

  3. naiguelsantos commented on 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.

  4. rodrigopk commented on 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 -aIx

  5. sanjeevyadavIT commented on Feb 23, 2017

    Thank you so much finally, something worked, but what was the issue causing it?

  6. pranjal815 commented on Feb 25, 2017

    Thank you so much @AliOsm I finally able to resolve the issue.

  7. michael-wise commented on 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?

  8. stonewallthomas commented on 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

  9. looeyf commented on 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.

  10. busterb commented on 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

  11. TheChisus commented on 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!

  12. Adilkemo commented on Jun 10, 2017

    thank you a lot Mr.@stonewallthomas your solutions is work on me

  13. dominiccodes commented on Jul 1, 2017

    Thanks stonewallthomas and gregkin

  14. 17 remaining items

  15. wallwood commented on 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: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 `

    '

  16. johnnyshields commented on Apr 26, 2018

    Bcrypt team, please fix this issue

  17. johnnyshields commented on May 10, 2018

    @luislavena is this something you could help with?

  18. luislavena commented on 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.

  19. johnnyshields commented on May 10, 2018

    @luislavena thank you that's very helpful. @larskanis or someone from this project can you please help?

  20. wallwood commented on May 10, 2018

    Hello,

    Its solve for me with step is below :

    1. Make sure you have installed DEVKIT, as default devkit has installed in C:\RailsInstaller\DevKits
    2. Open “mingw32env.cmd", Folder : C:\RailsInstaller\DevKit\mingw
    3. Change the directory to “C:\RailsInstaller\DevKit” and run "devkitvars.bat"
    4. After finished step 3, change the directory to “C:\RailsInstaller\Ruby2.3.3\lib\ruby\gems\2.3.0\gems\bcrypt-3.1.11-x86-mingw32\ext\mri”
    5. run “ruby extconf.rb”
    6. run "make"
    7. run "make isntall"
      Done !

  21. johnnyshields commented on May 10, 2018

    @wallwood they need to bundle new binaries with the gem for windows. then these steps won't be needed.

  22. larskanis commented on 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

    gem install bcrypt --platform=ruby
    

    or if you're using a Gemfile than

    gem "bcrypt", git: "https://github.com/codahale/bcrypt-ruby/"
    

    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.

  23. johnnyshields commented on 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?

  24. tjschuck commented on May 15, 2018

    Collaborator

    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 --prerelease now works on Windows? If so, I'll push out the final version.

  25. larskanis commented on 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_ext on Ruby-2.6. This is why I think it's better to no longer release fat binary gems.

  26. tjschuck commented on May 16, 2018

    Collaborator

    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 bcrypt on Windows with none of the above workarounds.

    Thanks, everyone!

  27. rubyyc commented on Dec 13, 2018

    @cahyowhy 我跟你报一样的错误,请问您最终是如何解决的?

  28. baladkb commented on May 28, 2019

    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.

    You saved me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL