How to avoid deprecation messages from RubyGems?

2019-01-23 15:56发布

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.

3条回答
Explosion°爆炸
2楼-- · 2019-01-23 16:15

Regenerating gem specifications worked for me: sudo gem pristine --all --no-extensions

See: https://github.com/rubygems/rubygems/blob/master/History.txt

You can also downgrade your version of rubygems: sudo gem update --system 1.7.1

查看更多
姐就是有狂的资本
3楼-- · 2019-01-23 16:16

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

查看更多
看我几分像从前
4楼-- · 2019-01-23 16:18

Look where your rubygems are installed:

$ gem list -d rubygems

Find the deprecate.rb file there, and make the self.skip class method always return true.

or If you're using RVM, the following command will fix it:

rvm rubygems current
查看更多
登录 后发表回答