【发布时间】:2014-04-17 06:13:08
【问题描述】:
我正在关注 Michael Hartl 的 Rails 4 教程,并且正在研究用户身份验证部分。他说将bcrypt-ruby 添加到Gemfile,然后添加bundle install。
这是我的 Gemfile 中的一行:
gem 'bcrypt-ruby', '3.1.2' // as explained at http://ruby.railstutorial.org/chapters/modeling-users#code-bcrypt_ruby
我运行bundle install,然后运行rails console 来测试系统。创建新用户会引发以下错误:
You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install
Gem::LoadError: can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.2. Make sure all dependencies are added to Gemfile.
bundle install 工作正常,没有抛出任何错误——为什么这里会失败,错误提示 bcrypt-ruby 未安装?
编辑:这似乎是这个问题的重复:Unable to activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.2?
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-4 bcrypt-ruby