[英]LoadError: cannot load such file — bcrypt_ext
I have tried to deploy devise authentication on my rails app. 我试图在我的rails应用程序上部署devise身份验证。
I am getting this issue 我收到了这个问题
"cannot load such file -- bcrypt_ext" “无法加载此类文件 - bcrypt_ext”
I see it is a common issue amongst windows based computers but the answers to other questions have not helped me yet. 我认为这是基于Windows的计算机中的常见问题,但其他问题的答案对我没有帮助。
I am running Windows 8 x64 with x86 ruby and devkit 我使用x86 ruby和devkit运行Windows 8 x64
try 尝试
C:\> gem install --no-ri --no-rdoc bcrypt
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
reference: https://www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x 参考: https : //www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x
bcrypt_ext.so file is missing -if you manually copy it to proper folder - in my case \\Ruby23\\lib\\ruby\\gems\\2.3.0\\gems\\bcrypt-3.1.11-x86-mingw32\\lib - it helps. 缺少bcrypt_ext.so文件 - 如果您手动将其复制到正确的文件夹 - 在我的情况下\\ Ruby23 \\ lib \\ ruby \\ gems \\ 2.3.0 \\ gems \\ bcrypt-3.1.11-x86-mingw32 \\ lib - 它有帮助。 :) :)
This worked for me: https://github.com/codahale/bcrypt-ruby/issues/142 这对我有用 : https : //github.com/codahale/bcrypt-ruby/issues/142
-Uninstall all bcrypt versions: gem uninstall bcrypt - 卸载所有bcrypt版本:gem uninstall bcrypt
select option 3 (uninstall all) 选择选项3(全部卸载)
-Uninstall all bcrypt-ruby versions: gem uninstall bcrypt-ruby - 卸载所有bcrypt-ruby版本:gem uninstall bcrypt-ruby
select option 3 (uninstall all) 选择选项3(全部卸载)
replace the line in your gemfile by: 用以下内容替换gemfile中的行:
to add this line to the gemfile: gem 'bcrypt', platforms: :ruby 将此行添加到gemfile:gem'bcrypt',platforms :: ruby
did not work for me though but to point the gemfile to the git repository did: 虽然不能为我工作但是将gemfile指向git存储库:
gem 'bcrypt', git: ' https://github.com/codahale/bcrypt-ruby.git ', :require => 'bcrypt' gem'bcrypt',git:' https : //github.com/codahale/bcrypt-ruby.git ',:require =>'bcrypt'
bundle install 捆绑安装
and you should be good to go 你应该好好去
At this link https://github.com/codahale/bcrypt-ruby/issues/142 在此链接https://github.com/codahale/bcrypt-ruby/issues/142
Somebody mentioned this solution 有人提到了这个解决方案
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
And it worked for me 它对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.