can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile

后端 未结 9 2002
不知归路
不知归路 2020-12-03 05:13

I have Rails 4.0.0 app. When I run bundle install command there is no problem. This is my GemFile.

source \'https://rubygems.org\'

# Bundle edge Rails inste         


        
9条回答
  •  失恋的感觉
    2020-12-03 06:05

    In your gemfile, you aren't specifying the version, so you're installing the latest version of bcrypt-ruby which is 3.1.1, but what you need is any version from 3.0.0 to 3.0.9. You can get this by adding a version constraint like so:

    gem 'bcrypt-ruby', '~> 3.0.0'
    

    The version requirement comes from ActiveModel's SecurePassword which currently has an explicit dependency on bcrypt-ruby (~> 3.0.0). You can see the dependency on github. When this code is executed, it looks for a version 3.0.0 through 3.0.9 which is not installed and so it throws an error.

    This dependency was just updated to '~> 3.1.0' a couple of days ago, but has not made its way into the rails activemodel gem yet. When it does, you'll have to update your version accordingly. Here's the commit if you're curious.

提交回复
热议问题