我正在学习Michael关于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?
发布于 2014-03-12 20:29:50
您需要bcrypt-ruby版本3.0.0
更改Gemfile中的版本
gem 'bcrypt-ruby', '~> 3.0.0'https://stackoverflow.com/questions/22362898
复制相似问题