`

遗留系统处理,升级到rails 2.×

阅读更多
一些关于低于rails 2.0的升级
gem update --system  #gem升级本身
gem update rails --include-dependencies  #rails升级

gem update activesupport#


Upgrading to Rails 2.0. A Recipe


1. 检查所有放弃使用的方法

最好的检查办法是下载[ur=http://topfunky.net/svn/plugins/deprecated/tasks/deprecated.rakel]rake task[/url]并放到lib/tasks目录,然后运行
rake deprecated

这个Rake任务,就会帮助你找到所有的弃用的方法。

2. 清理你的environment
这个文件初始化的时候,如果做了很多操作,往往会导致升级时候的错误。
mkdir config/initializers

重新生成初始化和配置文件是个不错的选择。

3. 更新 engine
引用

Even though a lot of the Rails engine is provided by the Rails gems, there is some boiler plate code that each app needs. This is created when you run the rails /path/to/app command. Well, to ensure that everything is up to date, we will do the same thing again. The rails command is smart enough to compare files for differences before overwriting them.
rails /path/to/your/app

You should now be asked “overwrite [file]? (enter “h” for help) [Ynaqdh]” for a whole bunch of files. Double check each filename before hitting yes - some of the files you WON’T want to overwrite (Examples are 404.html, 500.html, database.yml etc). If it is a configuration file you probably won’t want to overwrite it. It will also update the rubyScript libraries, so if you are reliant on those, you may want to say no there too.

I’ve found this is the best way to make sure everything is up to date.


4. 更新视图
参考这里更新视图
虽然,不是严格要求,但是最好还是把.rhtml换成html.erb对一致性比较好
还有一些插件还需要处理
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics