我想将我的一个应用程序从rails -2.3.11升级到4.0.0。 在做任何事情之前,我只需要为它和我的应用程序制定计划,但不是那么大,而是获得了一些6/7插件和5/6宝石。从2.3.11到4.0.0 Rails升级的最佳策略/实践是什么?
Existed : Ruby 1.8.7 + Rails 2.3.11
Expected : Ruby 2.0.0 + Rails 4.0.0
For this, I have plan as in two ways like below,
1).Multi-step process : First need to upgrade app from rails 2.* to 3.* and then
do upgrade from rails 3.* to 4.0.0
2).Create new application from rails - 4.0.0 and rebuild old application all
features as we have already css, layouts...
I hope both strategies will take same time.
Any how, I need some inputs from you all. So please share your thoughts/comments.
Thanks in advance.
如果rails 2.3.1运行在ruby 2.1.1上,我会(非常)惊讶。我可能会先开始迁移到最新版本的rails 2.3(可能需要15年),然后在迁移到rails 3之前迁移到ruby 1.9.2。根据我的经验,迁移到rails 3是最耗时的。如果不知道应用程序,很难判断这是否需要更多时间而不是重写它。即使在rails 4中,您也可以重用您的大部分视图和CSS代码(尽管从长远来看切换到SCSS将会付出代价)。 – Patru
啊是的。我的想法是升级Ruby更容易。先升级Ruby,然后升级Rails。 HTML&CSS是好的。我认为沿途你会遇到大量的弃用和删除功能,你需要改变你的模型和控制器和路线。 – juanitofatas