如何强制gem升级到gem 1.3.1

[英]How can I force gem to upgrade to gem 1.3.1


I am trying to install a gem like this:

我正在尝试安装这样的宝石:

C:\InstantRails\rails_apps\foodmarksthespot>ruby script/plugin install git://github.com/lazyatom/engines.git

Which returns this message:

返回此消息:

Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again.

But when I try to update using:

但是当我尝试更新时使用:

gem update --system

it says:

它说:

Updating RubyGems
Nothing to update

This is on windows. How can I force it to upgrade the system to a specific version?

这是在Windows上。如何强制它将系统升级到特定版本?

4 个解决方案

#1


16  

http://rubyforge.org/forum/forum.php?forum_id=28071

http://rubyforge.org/forum/forum.php?forum_id=28071

From there:

从那里:

NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no
rubygems-update installed. You will need to follow the second set of update
instructions if you see "Nothing to update".

If you have an older version of RubyGems installed, then you can still
do it in two steps:

$ gem install rubygems-update (again, might need to be admin/root)
$ update_rubygems (... here too)

#2


2  

For anyone stumbling upon this question recently: In order to install a specific older version of RubyGems (probably to maintain a legacy application, as I did) I had to do the following, as the previous answers didn't work:

对于最近绊倒这个问题的人:为了安装特定的旧版RubyGems(可能是为了维护遗留应用程序,就像我一样),我必须做以下事情,因为之前的答案不起作用:

$ gem install -v 1.3.7 rubygems-update && \    
$ ruby `gem env gemdir`/gems/rubygems-update-1.3.7/setup.rb    

$ gem -v 
1.3.7

As documented here: http://www.chentianwen.net/wordpress/2011/05/24/how-to-update-rubygems-to-a-specific-version/

如下所述:http://www.chentianwen.net/wordpress/2011/05/24/how-to-update-rubygems-to-a-specific-version/

#3


1  

If you want to install a specific version then try like the following.

如果要安装特定版本,请尝试以下操作。

$gem install -v=version_number package_name

$ gem install -v = version_number package_name

For example in your case it should be,

例如在你的情况下它应该是,

$gem install -v=1.3.1 RubyGems

$ gem install -v = 1.3.1 RubyGems

#4


0  

What do you get if you run gem --version in cmd? It sounds like the gem executable you are running in cmd is not the same one Rails is using.

如果你在cmd中运行gem --version会得到什么?听起来你在cmd中运行的gem可执行文件与Rails使用的不同。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2009/02/19/df2ca5b103d4224719f49f3003e73dfe.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号