如何避免RubyGems的弃用消息? [英] How to avoid deprecation messages from RubyGems?

查看:107
本文介绍了如何避免RubyGems的弃用消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gem update --system 之后,当我做了一些与rubygems相关的事情时,我收到了这条消息:


注:不推荐使用Gem :: Specification#default_executable =。它将在2011年10月1日或之后被删除。

Gem :: Specification#default_executable =从/usr/lib/ruby/gems/1.8/specifications/调用rubygems-update-1.7.2.gemspec:11。


我该如何避免它?我尝试删除rubygems并重新安装,但那并没有解决它。

解决方案

您可能需要重新生成您的宝石规格。


安装RubyGems 1.8.1后,您会在加载您的宝石时看到弃用。运行gem pristine --all --no-extensions可以安全地重新生成宝石规格。

http://blog.segment7.net/2011/05/05/rubygems-1-8-1


After gem update --system, when I do something related to rubygems, I receive this message:

NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.

Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/rubygems-update-1.7.2.gemspec:11.

How can I avoid it? I've tried to remove rubygems and reinstall, but that didn't fix it.

解决方案

You probably need to regenerate your gem specifications.

After installing RubyGems 1.8.1 you will see deprecations when loading your exsting gems. Run gem pristine --all --no-extensions to regenerate your gem specifications safely.

http://blog.segment7.net/2011/05/05/rubygems-1-8-1

这篇关于如何避免RubyGems的弃用消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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