Error stating that “bcrypt-ruby is not part of the bundle”, how can I add bcrypt-ruby to Gemfile?

后端 未结 6 738
伪装坚强ぢ
伪装坚强ぢ 2021-01-11 12:10

When I add has_secure_password to the model (inherited from ActiveRecord::Base), error stating that \"bcrypt-ruby is not part of the bundle\" occurs.

Here the log is

6条回答
  •  半阙折子戏
    2021-01-11 12:55

    Something that came up for me that is not addressed here yet. I got this error after going to a new system on which I installed Ruby 2.0.x.

    It turns out that even if I was using the new bcrypt 3.1.7 it didn't work for me until I ALSO had bcrypt-ruby 3.0.1 in the gemfile. I resisted that when I should have just taken the error at it's word.

    gems:

    bcrypt (3.1.7 ruby x86-mingw32)
    bcrypt-ruby (3.0.1 x86-mingw32, 3.0.0)
    

    gemfile:

    gem 'bcrypt-ruby', '~> 3.0.1'
    gem 'bcrypt', '~> 3.1.7'
    

    Before adding both I tried all sorts of single version combinations.

提交回复
热议问题