简体   繁体   English

gem install bcrypt(LoadError)

[英]gem install bcrypt (LoadError)

Still learning with the rails tutorial... I've been setting bcrypt (apparently) successfully from: 还在学习rails教程...我一直在设置bcrypt(显然)成功:

gem install bcrypt --platform=ruby

as it says 正如它所说

Successfully installed bcrypt-3.1.11
(...)
1 gem installed

But after adding this line in user.rb 但是在user.rb中添加这一行之后

has_secure_password 

I run a rails test, expecting just a red light for not having required a password confirmation in the user_test.rb file and actually I get an error preceded by 我运行了一个rails测试,因为没有在user_test.rb文件中需要密码确认而只是一个红灯,实际上我得到一个错误

You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install

OK then, I follow these instructions and bcrypt-3.1.11 (x86-mingw32) is in the list. 好的,我按照这些说明操作,bcrypt-3.1.11(x86-mingw32)在列表中。 Again I try a rails test and here I get a LoadError 我再次尝试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)

And that's right, there is no file named bcrypt_ext anywhere! 那是对的,在任何地方都没有名为bcrypt_ext的文件! So what ? 所以呢 ?

I'm wondering about DevKit as mentionned here Rails Gem::LoadError in UsersController#new In my first try, it is stated "temporarily enhancing PATH to include DevKit..." 我想知道在这里提到的DevKit Rails Gem ::在UsersController中的LoadError #new在我的第一次尝试中,它被称为“暂时增强PATH以包括DevKit ......”

Kart-able; 卡丁车 - 能;

try the following steps which worked for me: 尝试以下为我工作的步骤:

Run 'bundle install' at the root of your project and it should work. 在项目的根目录运行“bundle install”,它应该可以运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM