Ruby-Digest :: Digest已过时;使用摘要 [英] Ruby - Digest::Digest is deprecated; Use Digest

查看:113
本文介绍了Ruby-Digest :: Digest已过时;使用摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我运行测试或启动Rails服务器时,我都会收到此警告.

I've been getting this warning whenever I run my tests or start rails server.

当我从.rvm文件夹运行grep时,会看到以下内容:

When I run grep from .rvm folder I see the following:

grep -R 'Digest::Digest' .
./rubies/ruby-2.1.0/lib/ruby/2.1.0/openssl/digest.rb: warn('Digest::Digest is deprecated; Use Digest')
- additional references to openssl and ruby 2.1.0

所以看起来这是Ruby 2.1.0错误.是否有任何修复程序?据我所知,还没有可用的补丁.

So it looks like it's a Ruby 2.1.0 bug. Are there any fixes? There are no patches available yet as far as I can tell.

虽然我的应用程序使用了Fog和许多其他与此消息相关的宝石,但我使用的是没有错误的补丁程序版本.所以我认为Ruby在这里是错的.

Whilst my app uses Fog and a bunch of other gems that have issues relating to this message, I'm using patched versions that don't have the bug. So I reckon Ruby is at fault here.

推荐答案

此线程中借用回复

Borrowing the reply from this thread

不建议从OpenSSL :: Digest :: Digest >非常古老的时代,例如Ruby 1.8 ,最后最近已被弃用.

OpenSSL::Digest::Digest has been discouraged to use from very ancient era such as Ruby 1.8 and finally was deprecated recently.

如果您搜索错误消息,您会发现很多宝石,包括包括雾,仍然使用不推荐使用的语法.

If you search for the error message, you will see that a lot of gems, including fog, were still using the deprecated syntax.

我认为所有宝石都需要一段时间才能更新.如果您在使用的其中一个库中遇到了弃用问题,建议您向维护者报告.

I assume it will take a while before all the gems will be updated. If you came across the deprecation in one of the libs you use, I encourage you to report it to the maintainer.

这里有几个例子

  • https://github.com/fog/fog/pull/2473
  • https://github.com/alexreisner/geocoder/pull/580
  • https://github.com/ruby/ruby/pull/446

您的Rails应用可能取决于使用该旧语法的gem.

It's likely your Rails app depends on a gem that is using that old syntax.

这篇关于Ruby-Digest :: Digest已过时;使用摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆