InstantRails-2.0中的rails升级

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

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

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

     这是由于gem的配置太低,没法进行远程更新,执行gem -v 发现是1.0.1ruby

三、从下面这个地址下载 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,出现信息fetch

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 READMEgoogle

四、执行update_rubygems,再执行gem -v,发现更新成功;spa

五、执行gem install rack -v=1.0.0.net

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...命令行

更新成功

六、再次执行 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,发现已更新成功

注:执行第6步时,有时会不成功,能够到http://www.garbagecollect.jp/ruby/mswin32/ja/download/release.html处下载ruby-1.8.7-p249-i386-mswin32.zip,而后解到InstantRails-2.0-win\ruby下,执行 gem install -v=2.3.2 rails就能够更新成功了(此法由houjzhong 提供,在此致谢!)


总结:

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

联机更新过程当中若是出现HTTP Response 302 fetching http://rubygems.org/yaml没法更新,有两种状况

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

此时能够试着加入其余服务器地址

 gem source -l  查看列表

 gem source -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/中的地址。

相关文章
相关标签/搜索