首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何修复Rubygems最近的弃用警告?

如何修复Rubygems最近的弃用警告?
EN

Stack Overflow用户
提问于 2011-05-10 19:47:07
回答 8查看 22.9K关注 0票数 22

我最近运行了更新:

代码语言:javascript
复制
gem update --system
gem update

现在,每次加载gem时,我都会收到很多不推荐使用的警告。例如,rails console

代码语言:javascript
复制
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 /Users/user/.rvm/gems/ruby-1.9.2-p180@global/specifications/rake-0.8.7.gemspec:10.
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 /Users/user/.rvm/gems/ruby-1.9.2-p180@global/specifications/rake-0.8.7.gemspec:10.
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 /Users/user/.rvm/gems/ruby-1.9.2p180@global/specifications/rake-0.8.7.gemspec:10.
Loading development environment (Rails 3.0.7)
ruby-1.9.2-p180 :001 > exit

我使用的是RVM、Ruby 1.9.2和Rubygems 1.8.1。有没有办法绕过这个问题?恢复到旧版本的rubygems?

EN

回答 8

Stack Overflow用户

回答已采纳

发布于 2011-05-10 19:59:58

我不得不降级到1.6.2。这些通知绝对是荒谬的。它们使得最新版本完全不可用。确实应该有一种方法来禁用它们,但在此之前:

sudo gem update --system 1.6.2

票数 21
EN

Stack Overflow用户

发布于 2011-05-21 12:42:36

您还可以使用更多特定于RVM的rvm rubygems current来返回到更安全的gem版本(现在是1.6.2)。

票数 8
EN

Stack Overflow用户

发布于 2011-05-20 02:36:14

我接受了别人的答案,并把它们写成了对我来说更有效的东西。我仍然需要从/usr/local/cellar中手动删除几个。

代码语言:javascript
复制
#!/usr/bin/env bash
#

brew install gnu-sed
sudo gem pristine --all --no-extensions
gems=$(gem -v 2>&1 | grep called | gsed -r -e 's#^.*specifications/##' -e 's/-[0-9].*$//')

for gem in $gems
do
  echo Fixing $gem...
  sudo gem pristine $gem -- -build-arg
done
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5949521

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档