还在学习rails教程...我一直在设置bcrypt(显然):
gem install bcrypt --platform=ruby
正如它所说的
Successfully installed bcrypt-3.1.11
(...)
1 gem installed
但在user.rb中添加此行后
has_secure_password
我运行了一个rails测试,因为没有在user_test.rb文件中需要密码确认而只是红灯,实际上我得到一个错误
You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install
好的,我按照这些说明操作,bcrypt-3.1.11(x86-mingw32)在列表中。我再次尝试rails测试,在这里我得到一个LoadError
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in 'require': cannot load such file -- bcrypt_ext (LoadError)
没错,在任何地方都没有名为bcrypt_ext的文件!那是什么?
我想知道这里提到的DevKit Rails Gem::LoadError in UsersController#new 在我的第一次尝试中,它被称为“暂时增强PATH以包括DevKit ......”