具体过程如下:

1、InstantRails-2.0安装后,在配置环境变量path中配置ruby/bin目录(如果系统中有多个RUBY,执行命令行的时候系统认的就是path中的)

2、进入DOS命令行,执行gem update --system,结果

Updating RubyGems... 
ERROR:  While executing gem ... (Gem::RemoteSourceException) 
HTTP Response 302 fetching http://rubygems.org/yaml

这是因为gem的配置过低,无法进行远程更新,执行gem -v 发现是1.0.1

3、从下面这个地址下载 rubygems-update-1.3.7.gem,http://rubyforge.org/frs/download.php/70695/rubygems-update-1.3.7.gem

然后DOS命令进行该文件所在的目录,执行gem install --local rubygems-update-1.3.7.gem,出现信息

Successfully installed rubygems-update-1.3.7 
1 gem installed 
Installing ri documentation for rubygems-update-1.3.7... 
Installing RDoc documentation for rubygems-update-1.3.7... 
Could not find main page README 
Could not find main page README 
Could not find main page README 
Could not find main page README

执行gem -v查看,发现并没有更新成功,Could not find main page README是什么意思我没弄明白,但是我从http://production.s3.rubygems.org/yaml上发现这么一句

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 
我照着再执行 update_rubygems,接着出现的信息很多,就不帖出来,再执行gem -v,发现更新成功,已经是1.3.7了

这一步是一切成功的源泉!!!!!!

4、接着再执行gem update --system,提示

Updating RubyGems 
Nothing to update

这是为什么我不明白,请高手指点一下

5、再执行gem update rails --include-dependencies,提示信息

Updating installed gems 
Updating rails 
ERROR:  Error installing rails: 
        actionpack requires rack (~> 1.0.0, runtime) 
Gems updated: activesupport, activerecord 
Installing ri documentation for activesupport-2.3.3... 
Installing ri documentation for activerecord-2.3.3... 
Installing RDoc documentation for activesupport-2.3.3... 
Installing RDoc documentation for activerecord-2.3.3...

执行rails -v,发现还是2.0.2没有更新成功,根据actionpack requires rack (~> 1.0.0, runtime),应该是actionpack 需要1.0.0版本的rack

6、执行gem install rack -v=1.0.0

Successfully installed rack-1.0.0 
1 gem installed 
Installing ri documentation for rack-1.0.0... 
Installing RDoc documentation for rack-1.0.0...

更新成功

7、再次执行 gem update rails --include-dependencies

出现信息

Updating installed gems 
Updating rails 
Successfully installed rake-0.8.7 
Successfully installed activesupport-2.3.8 
Successfully installed activerecord-2.3.8 
Successfully installed rack-1.1.0 
Successfully installed actionpack-2.3.8 
Successfully installed actionmailer-2.3.8 
Successfully installed activeresource-2.3.8 
Successfully installed rails-2.3.8 
Gems updated: rake, activesupport, activerecord, rack, actionpack, actionmailer, activeresource, rails 
Installing ri documentation for rake-0.8.7... 
Installing ri documentation for activesupport-2.3.8... 
Installing ri documentation for activerecord-2.3.8... 
Installing ri documentation for rack-1.1.0... 
Installing ri documentation for actionpack-2.3.8... 
Installing ri documentation for actionmailer-2.3.8... 
Installing ri documentation for activeresource-2.3.8... 
Installing ri documentation for rails-2.3.8... 
Installing RDoc documentation for rake-0.8.7... 
Installing RDoc documentation for activesupport-2.3.8... 
Installing RDoc documentation for activerecord-2.3.8... 
Installing RDoc documentation for rack-1.1.0... 
Installing RDoc documentation for actionpack-2.3.8... 
Installing RDoc documentation for actionmailer-2.3.8... 
Installing RDoc documentation for activeresource-2.3.8... 
Installing RDoc documentation for rails-2.3.8...

执行rails -v,发现已更新成功

总结:rails更新有两种方式:1、联机更新;2本地更新

联机更新过程中如果出现HTTP Response 302 fetching http://rubygems.org/yaml无法更新,有两种情况

一是gem的版本过低,二是与服务器的连接不通

此时可以试着加入其他服务器地址

gem source -l  查看列表

gem source -a http://rubygems.org 加入新的服务器地址

或者直接gem install rubygems-update --source http://rubygems.org

本地更新需要下载相应的gem包,版本需与要更新的rails版本对应,同时安装顺序有要求,因此gem包之间有依赖关系

顺序从上面的显示信息中可以看出来

Successfully installed rake-0.8.7 
Successfully installed activesupport-2.3.8 
Successfully installed activerecord-2.3.8 
Successfully installed rack-1.1.0 
Successfully installed actionpack-2.3.8 
Successfully installed actionmailer-2.3.8 
Successfully installed activeresource-2.3.8 
Successfully installed rails-2.3.8

至于gem包的下载地址都在http://rubyforge.org/,但是有些项目的并不好找到,可以在google中直接搜索,就能找到在http://rubyforge.org/中的地址。

gem update --system 302 错误 解决方案(转)的更多相关文章

  1. gem update --system

    gem update --system 修改完gem sources之后,进行gem update: gem update --system 之后的输出: C:\Sites\test01>gem ...

  2. 完美解决方案,可排除DATASET不支持System.Nullable错误

    完美解决方案,可排除DATASET不支持System.Nullable错误 using System; using System.Collections.Generic; using System.L ...

  3. git pull时 git cannot lock ref XXXXXX (unable to update local ref)错误解决方案

    git pull :  git cannot lock ref    XXXXXX (unable to update local ref) pull代码的时候出现的错误,导致代码拉不下来. 看了一下 ...

  4. Oracle Ora 错误解决方案合集

    注:本文来源于 < Oracle学习笔记 --- Oracle ORA错误解决方案 > ORA-00001: 违反唯一约束条件 (.)错误说明:当在唯一索引所对应的列上键入重复值时,会触发 ...

  5. uploadify 文件上传报http 302错误

    uploadify文件上传会报http 302错误,在配置文件中将处理上传的通用类取消验证, 假设上传的通用处理类是fileUpload.ashx,则在配置文件同添加下面过滤配置能解决问题. < ...

  6. uploadify 报http 302错误

    uploadify 报http 302错误 原因是系统采用Forms认证,服务端加入匿名认证即可 具体配置如下: <location path="Base/Base/Upload&qu ...

  7. mysql 1577、1548错误 解决方案

    mysql 1577.1548错误 解决方案 1.mysql版本: 5.5.12 2.问题原因: 使用Navicat导出数据库的提示 :1577 – Cannot proceed because sy ...

  8. 使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误。

    使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误. 除了重新clone一份代码外,还可以使用如下解决方案: .切 ...

  9. MVC中使用jquery uploadify上传图片报302错误

    使用jquery uploadify上传图片报302错误研究了半天,发现我上传的action中有根据session判断用户是否登录,如果没有登录就跳到登陆页,所以就出现了302跳转错误.原来更新了fl ...

随机推荐

  1. NFC应用(一)卡应用

    门禁卡.停车卡.公交卡工作于NFC的卡模式,是目前日常生活中接触得最多的NFC应用场合.一张小小的卡片,轻触读卡器使可开门禁锁.进出停车场.支付车资,即快捷方便,又安全,易于管理. 以门禁系统为例,通 ...

  2. SQL Server 2008空间数据应用系列七:基于Bing Maps(Silverlight) 的空间数据展现

    原文:SQL Server 2008空间数据应用系列七:基于Bing Maps(Silverlight) 的空间数据展现 友情提示,您阅读本篇博文的先决条件如下: 1.本文示例基于Microsoft ...

  3. jquery中使用offset()获得的div的left=0,top=0

    写东西的时候要获取div的left和top,但怎么也取不到值都为0,但在chrome的console下是可以取到值的, 瞬间就纳闷了,于是乎就在网上找各种方法,大家一般的问题可能都是要获取的div被隐 ...

  4. Google map v3 using simple tool file google.map.util.js v 1.0

    /** * GOOGLE地图开发使用工具 * @author BOONYACHENGDU@GMAIL.COM * @date 2013-08-23 * @notice 地图容器的(div)z-inde ...

  5. Reverse Linked List 解答

    Question Reverse a singly linked list. Solution 1 -- Iterative Remember to set head.next = null or i ...

  6. Gradle+Jetty实现静态资源的热部署

    本文转自http://www.cnblogs.com/huang0925/p/3302487.html --------------------------------------- 通过Gradle ...

  7. 企业OA面临的问题,以及解决问题的推荐

          现在的企业不管大小都趋于软件话,而办公用的OA软件更是成为了企业中不可获取的一环,一个好的软件能让企业发展的更加顺利,而一个不合适的软件可能让公司哀声怨道反而起了反作用!       OA ...

  8. sql语句收集

    一.基础 1.说明:创建数据库CREATE DATABASE database-name 2.说明:删除数据库drop database dbname3.说明:备份sql server--- 创建 备 ...

  9. 执行此安装程序之前,必须安装 32 位 Windows 映像处理组件(WIC)解决的方法

    我们在Windows Service 2003上安装 Microsoft .NET Framework4.0时常常出现以下的报错 执行此安装程序之前,必须安装 32 位 Windows 映像处理组件( ...

  10. linux查看用户登录信息-w命令

    NAME w - Show who is logged on and what they are doing. SYNOPSIS w - [husfV] [user] DESCRIPTION w di ...