如何处理不推荐使用的gem警告(SourceIndex#all_gems)? [英] How to handle deprecated gem warning (SourceIndex#all_gems)?

查看:124
本文介绍了如何处理不推荐使用的gem警告(SourceIndex#all_gems)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行软件包更新之后,今天收到此消息:

  $软件包更新
注意:不推荐使用Gem :: SourceIndex#all_gems。它将在2011年10月1日或之后删除。
Gem :: SourceIndex#all_gems从/Users/meltemi/.rvm/gems/ruby-1.9.2-p180@ppr3/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:256调用b $ b。

任何人都知道它是什么意思以及如何解决它?



注意:这是一个Rails 3.0.7环境

解决方案

当我升级到rubygems 1.8.0时,在非Rails环境中的宝石。每当需要rubygems时,我都会收到警告。看看'网络,它似乎也可能是一个问题,与rubygems 1.7.x,但我从来没有安装这些版本之一,所以我不知道。我通过运行来解决这个问题:

  gem pristine --all --no-extensions 

我不得不运行它几次 - 它一直保持错误状态(但通常不是从运行到运行的相同位置)。最后,它已经足够了,它已经解决了我的大部分宝石。



有几个宝石没有正确地重新生成它们的规格(json和续集,特别是在我的情况),因为他们需要建立一个扩展。 (gem命令输出表明它正在跳过它们,但在所有弃用警告中很容易错过这些消息。)对于那些宝石,我卸载了它们,然后再次重新安装它们(它们以前已被捆绑器安装在rubygems 1.5 .x)并修复了其余的警告。这可能是因为我本来可以从这个攻击计划开始,但是我没有尝试过。

Got this message today after running bundle update:

$ bundle update
NOTE: Gem::SourceIndex#all_gems is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::SourceIndex#all_gems called from /Users/meltemi/.rvm/gems/ruby-1.9.2-p180@ppr3/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:256
.

Anyone know what it means and how to address it?

Note: This is a Rails 3.0.7 environment

解决方案

I got the same errors for a bunch of my gems in a non-Rails environment when I upgraded to rubygems 1.8.0. I got the warnings any time rubygems is required. Looking around the 'Net, it seems like it might be a problem also with rubygems 1.7.x, but I never had one of those versions installed so I'm not sure. I fixed this by running:

gem pristine --all --no-extensions

I had to run it a few times - it kept erroring out (but usually not in the same place from run to run). Eventually it got far enough that it had addressed the majority of my gems.

There were a few gems that didn't get their specifications regenerated correctly (json and sequel, specifically in my case) because they needed to build an extension. (The gem command output indicated it was skipping them, though it was easy to miss that message amidst all the deprecation warnings.) For those gems, I uninstalled them and then reinstalled them again (they'd previously been installed by bundler in rubygems 1.5.x) and that fixed the remaining warnings. It may be that I could have started with that plan of attack originally, but I didn't try.

这篇关于如何处理不推荐使用的gem警告(SourceIndex#all_gems)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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