如果我要求安装给定的 gem,我想知道它的版本。例如,(在撰写本文时)如果我执行gem install rails
它将安装4.0.0
. 但我宁愿只是问gem
而不是去https://rubygems.org/gems/rails
例子:
-bash> gem info rails -v
4.0.0
另外,我想知道它可以安装哪些版本。同样,不必去 RubyGems—— https ://rubygems.org/gems/rails/versions——我只想询问gem
最新10
版本:
-bash> gem info rails -v 10
4.0.1.rc1 October 17, 2013 (1.48 MB)
4.0.0 June 25, 2013 (1.47 MB)
4.0.0.rc2 June 11, 2013 (1.47 MB)
4.0.0.rc1 April 29, 2013 (1.49 MB)
4.0.0.beta1 February 26, 2013 (1.49 MB)
3.2.15 October 16, 2013 (4.5 KB)
3.2.15.rc3 October 11, 2013 (4.5 KB)
3.2.15.rc2 October 4, 2013 (4.5 KB)
3.2.15.rc1 October 3, 2013 (4.5 KB)
3.2.14 July 22, 2013 (3.5 KB)
类似这样的 CLI 是否存在gem
?
顺便说一句,如果没有-v
它会告诉我 RubyGems 网页告诉我的等价物,那就太酷了:
-bash> gem info rails
About: Ruby on Rails is a full-stack web framework optimized for programmer
happiness and sustainable productivity. It encourages beautiful code
by favoring convention over configuration.
Author: David Heinemeier Hansson
Version: 4.0.0
Total downloads: 28,483,741
For this version: 801,825
License: MIT
RubyGems: https://rubygems.org/gems/rails
Homepage: http://www.rubyonrails.org/
Source Code: http://github.com/rails/rails
Documentation: http://api.rubyonrails.org/
Wiki: http://wiki.rubyonrails.org/
Mailing List: http://groups.google.com/group/rubyonrails-talk
Bug Tracker: http://github.com/rails/rails/issues
Gemfile:
gem "rails", "~> 4.0.0"
Versions:
4.0.1.rc1 October 17, 2013 (1.48 MB)
3.2.15 October 16, 2013 (4.5 KB)
3.2.15.rc3 October 11, 2013 (4.5 KB)
3.2.15.rc2 October 4, 2013 (4.5 KB)
3.2.15.rc1 October 3, 2013 (4.5 KB)
https://rubygems.org/gems/rails/versions
Runtime Dependencies:
actionmailer = 4.0.0
actionpack = 4.0.0
activerecord = 4.0.0
activesupport = 4.0.0
bundler < 2.0, >= 1.3.0
railties = 4.0.0
sprockets-rails ~> 2.0.0