简体   繁体   English

如何检查更新的宝石版本?

[英]how to check for a newer gem version?

I have the following in my Gemfile : 我的Gemfile有以下Gemfile

gem 'rspec-rails', '2.8.1'

Is there a command available which indicates if there is a more update version available (or maybe list all versions)? 是否有可用的命令指示是否有更新版本可用(或列出所有版本)?

I understand that RubyGems does list current versions. 我知道RubyGems会列出当前版本。

I looked at bundle update ( http://docs.rubygems.org/read/chapter/10#page40 ) but it doesn't seem to have a "dry-run" option. 我查看了bundle updatehttp://docs.rubygems.org/read/chapter/10#page40 ),但它似乎没有“干运行”选项。

gem outdated -r |grep rspec-rails (see gem help outdated ) gem outdated -r |grep rspec-rails (请参阅gem help outdated

In your code you can write something like that: 在您的代码中,您可以编写类似的内容:

if `gem outdated -r`.include? "rspec-rails"
  # ....
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM