当我向模型添加has_secure_password(继承自ActiveRecord :: Base)时,会发生错误,指出“bcrypt-
ruby不是bundle的一部分”.
这里的日志是:
Started GET "/users" for 127.0.0.1 at 2012-02-19 16:37:12 +0900 Gem::LoadError (bcrypt-ruby is not part of the bundle. Add it to Gemfile.): app/models/user.rb:3:in `<class:User>' app/models/user.rb:1:in `<top (required)>' app/controllers/users_controller.rb:1:in `<top (required)>'
我安装了bcrypt-ruby
$gem install bcrypt-ruby Building native extensions. This could take a while... 1 gem installed Installing YARD (yri) index for bcrypt-ruby-3.0.1... Installing RDoc documentation for bcrypt-ruby-3.0.1...
但没有效果.
我试过了
$bundle exec rails server
但没有帮助.
如果我注释掉“has_secure_password”行,这个错误不会出来.
如何解决这个问题?