LoadError: cannot load such file — bcrypt_ext on Windows 2008 x64 server

前端 未结 9 1420
醉酒成梦
醉酒成梦 2020-12-30 04:32

I upgraded my environment from Ruby 2.0.0 to 2.2.3.

I also upgraded (overwrite) DevKit, and re-run ruby dk.rb install.

I removed Gemfile.lock and ran bundle

相关标签:
9条回答
  • 2020-12-30 04:55

    I had the same problem:

    cannot load such file — bcrypt_ext


    Windows 8.1 64bit

    ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

    Rails 5.1.4


    My solution:

    1. gem uninstall bcrypt-ruby
    2. gem uninstall bcrypt
    3. gem install bcrypt –platform=ruby
    4. added this whole line to Gemfile:

    gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'

    1. bundle install
    0 讨论(0)
  • 2020-12-30 04:57

    @user1185081 's solution worked for me in a windows machine. I ran following commands and worked like magic:

    $ cd C:\RailsInstaller\Ruby2.2.0\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri  
    $ ruby extconf.rb
    $ C:\<DevKit Path>\devkitvars.bat  (assuming you have devkit installed)(Ran this instead of running "make" because it was not recognized as an internal or external command)
    $ make install
    
    0 讨论(0)
  • 2020-12-30 04:58

    This process is for windows:

    The problem is with the programs installed on the system.

    Uninstall all rails programs:

    1. All Ruby programs.

    2. RailsInstaller.

    Removes all files that have been able to uninstall, you have to do it manually inside:

    C:\RailsInstaller

    1. Install de ruby version 2.2 from:

    http://railsinstaller.org/en

    Wait a moment and it's already to go.

    MarlonJon.es

    0 讨论(0)
  • 2020-12-30 05:01

    I spent an entire hour fixing this, just now.

    Well what I did was I followed some advice online to do a

    gem install bcrypt --platform=ruby
    

    And then, it worked in irb.

    irb(main):001:0> require 'bcrypt'
    => true
    

    Later when I had to do a bundle install, for some odd reason rails installed another bcrypt and the error was back. So I had two folders in my gem root.

    bcrypt-3.1.10
    bcrypt-3.1.10-x64-mingw32
    

    So, since the first folder was the one that got built with the devkit, and it works. I deleted the contents of the second folder and copied the contents of the first into it.

    Seems to be working as I'm writing this.

    0 讨论(0)
  • 2020-12-30 05:07

    In my case, a designating of the old version to bcrypt in Gemfile was a cause of the error. I removed a designating of the version and run bundle update bcrypt, then it was settled.

    0 讨论(0)
  • 2020-12-30 05:08

    Here is the solution worked for me:

        C:\> gem uninstall brcypt
        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
    
    0 讨论(0)
提交回复
热议问题