天天看点

关于rails2.0的安装

gems update 的时候,如果遇到这种情况:

[code]D:\InstantRails\rails_apps>gem install activesupport-2.0.1

ERROR: While executing gem ... (RuntimeError)

Error instaling activesupport-2.0.1:

invalid gem format for activesupport-2.0.1.gem[/code]

其实是update过程中下载的文件出现的错误,所以不能format,我们可以到下载文件的目录:

[code]D:\InstantRails\ruby\lib\ruby\gems\1.8\cache[/code]

对更新失败的文件进行删除或改名,再从新gem update就可以了。

关于rails2.0d的安装,出现失败是有可能是因为activesupport安装失败,特别是使用nerbean6.0的用户,大家要注意。

所以update rails2.0 的时候应该输入

[code]gem install rails --include-dependencies[/code]

或者

[code]

gem install rails --include-dependencies --source http://gems.rubyonrails.org/ [/code]

如果遇到其他问题,请细心看看提示里面出错的文件,我第一次就是activesupport文件出错了,如果在netbeans的tools=>ruby gems里面,uninstall activesupport(全部版本都卸载),然后再重新按照上面的方法 gem install rails就可以了。