How do you figure out what the older versions are for a particular Ruby Gem?
你如何弄清楚特定Ruby Gem的旧版本是什么?
I need to revert to an older version of the rack gem but I'm not sure which versions are available.
我需要恢复到旧版本的机架宝石,但我不确定哪些版本可用。
3 个解决方案
#1
You can use the gem command for this, like so:
您可以使用gem命令,如下所示:
gem query --remote -a -n ^rack$
The -n switch of query restricts the search by regular expression, so in this case you only get the gem whose name exactly matches the string "rack".
查询的-n开关通过正则表达式限制搜索,因此在这种情况下,您只能获得名称与字符串“rack”完全匹配的gem。
#2
Go to
http://rubyforge.org/projects/#{gem_name}/
Click on 'Files' in the navbar and look at what .gem
files are available. Those files are the official source of Rubygems.
单击导航栏中的“文件”,查看可用的.gem文件。这些文件是Rubygems的官方来源。
#3
And if you want to know the old versions you have installed, use gem list:
如果您想知道已安装的旧版本,请使用gem list:
$ gem list
*** LOCAL GEMS ***
actionmailer (2.3.2, 2.3.1, 2.3.0, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)
actionpack (2.3.2, 2.3.1, 2.3.0, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)
activerecord (2.3.2, 2.3.1, 2.3.0, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)
...
#1
You can use the gem command for this, like so:
您可以使用gem命令,如下所示:
gem query --remote -a -n ^rack$
The -n switch of query restricts the search by regular expression, so in this case you only get the gem whose name exactly matches the string "rack".
查询的-n开关通过正则表达式限制搜索,因此在这种情况下,您只能获得名称与字符串“rack”完全匹配的gem。
#2
Go to
http://rubyforge.org/projects/#{gem_name}/
Click on 'Files' in the navbar and look at what .gem
files are available. Those files are the official source of Rubygems.
单击导航栏中的“文件”,查看可用的.gem文件。这些文件是Rubygems的官方来源。
#3
And if you want to know the old versions you have installed, use gem list:
如果您想知道已安装的旧版本,请使用gem list:
$ gem list
*** LOCAL GEMS ***
actionmailer (2.3.2, 2.3.1, 2.3.0, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)
actionpack (2.3.2, 2.3.1, 2.3.0, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)
activerecord (2.3.2, 2.3.1, 2.3.0, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)
...