无法激活 bcrypt-ruby (~> 3.0.0),已经激活 bcrypt-ruby-3.1.2? [英] Unable to activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.2?
问题描述
我正在尝试安装 bcrypt 来处理密码.
I'm trying to install bcrypt to handle passwords.
我运行 gem install bcrypt-ruby
并得到:
....Successfully installed bcrypt-ruby-3.1.2
我添加了 gem "bcrypt-ruby", "~> 3.1.2"
并运行 bundle install
,然后重新启动了运行程序的服务器,但我得到了错误:
I added gem "bcrypt-ruby", "~> 3.1.2"
and ran bundle install
, and restarted the server which ran the program but I got the error:
get Gem::LoadError in UsersController#new
can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.2. Make sure all dependencies are added to Gemfile.
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
**has_secure_password** <---Error
validates :password, length: { minimum: 6 }
end
推荐答案
~>3.0.0
版本与 ~> 冲突3.1.2
一,因为比较发生在3.0.~
和3.1.~
,并且失败.你刮胡子改~>3.0.0
到 ~>3.0
,为了比较3.~
和3.1
.
The ~> 3.0.0
version conflicts with ~> 3.1.2
one, because comparison takes place 3.0.~
to 3.1.~
, and failed. You shave to change ~> 3.0.0
to ~> 3.0
, in order to compare 3.~
to 3.1
.
如果你做不到,你必须查看Gemfile.lock,哪个gem需要3.1.2
版本的bcrypt-ruby代码>,并尝试将其降级.
If you are unable to do it, you have to see into Gemfile.lock, which gem require 3.1.2
version of bcrypt-ruby
in, and try to downdrade it.
这篇关于无法激活 bcrypt-ruby (~> 3.0.0),已经激活 bcrypt-ruby-3.1.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!