gem update --system 302 错误 解决方案(转)
具体过程如下:
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/中的地址。
相关文章
- MySQL字符集你还在使用错误的utf8?
- 【VS开发】【计算机视觉】使用opencv静态库编译程序时爆出错误的解决方案
- HTTP Error 500.22 - Internal Server Error 错误解决方案
- 【Windows】U 盘装系统,无法格式化所选磁盘分区[错误: 0x8004242d]解决方案
- IDEA 错误:非法字符:“ufeff”解决方案
- MySQL升级后1728错误解决方案
- ERP程序开发中遇到的六种错误
- 在开发 ExtJS 应用程序常犯的 10 个错误
- 关于iOS 报Command failed with exit 128: git错误额解决方案
- 关于React Native报Cannot initialize a parameter of type ‘NSArray<id<RCTBridgeModule>>错误的解决方案
- 你与其他程序员可能常犯的 6 个错误
- android xml 布局错误(黑掉了)Missing styles. Is the correct theme chosen for this layout?
- 内存错误:CRT detected that the application wrote to memory after end of heap buffer
- MYSQL中'TYPE=MyISAM'错误的解决方案
- ***PHP中error_reporting()用法详解(含codeigniter框架中屏蔽错误提示的解决方案)
- 错误卸载软件导致Windows7系统中的软件无法播放视频
- htc 常见错误和解决方案
- NavicatPremium12连接Oracle11g报ORA-28547错误
- 【错误记录】exe4j 导出的 exe 可执行程序乱码 ( Configure Java Invocation VM Parameters 配置 -Dfile.encoding=GBK 编码 )
- 在visual studio 2022 C++中配置最新版OpenCV和可能错误解决方案
- [译] Pull request review 的十大错误
- freebsd sm-mta 错误解决办法
- python easy_install 发生Unable to find vcvarsall.bat错误的处理方法
- django --fields.E304 错误解决方案