Time to upgrade to Rails 3 or not?
I'm about to revisit an application that I've been trying to get off the ground for nearly a year now (keep getting sidetracked and too depressed to bother with it). The app was started with Rails 2.3, I believe and had a very minute amount of work done before it got abandoned. Coming back to Rails at this time, I see that 3.0 has been releas开发者_如何学运维ed.
Since the application is basically still greenfield and totally new, should I redo it from scratch using Rails 3, or stick with Rails 2 that I already have some very trivial work done already? It wouldn't take long to redo the existing work (it's basically like just one or two models), but I have not visited Rails or the Rails community for several months now and I'm guessing there are a lot of changes since I last used it.
You should absolutely use rails3 and Ruby 1.9.2 in a situation like this.
There are a lot of free and paid resources on how to upgrade applications and all of the current documentation and gems are going to be written for rails3. Sure, there are some gems that haven't updated yet, but because of the long beta and rc phase of rails3, now that the final is out the big ones are compatible or have forks on github that are. You can always check with railsplugins.org if there's a question for a particular gem.
A lot of methods from rails2 to rails3 have just been deprecated and will give warnings, but come rails3.1 those old methods will be removed or extracted to plugins, so there's no reason to write code that will just be deprecated soon.
For a new project that will be deployed in a new server I'd recommend migrating to Rails 3.
If the app will be in a server with some Rails 2.3 apps on it maybe you should first check if some gems incopatibilies don't come up. This was my case last week so I'm stuck with Rails 2.3 for a bit longer.
精彩评论