Keeping up with Rails versions and hosting
As Rails does change quite a bit fairly quickly could somebody please share their experiences maintaing an existing application as Rails develops. How does a hosting service like Heroku handle this? Do hosts support legacy versions of rails or would one be at the mercy of the host to upgrade an app?
Edit:
With a framework such as Asp.net which is not updated that frequently, it would seem to me that fewer apps would be broken due less quickly. Is a develope开发者_运维技巧r always chasing after the next version of rails?
With Gems and now Bundler, this isn't really an issue. To keep your application up to date, all you have to do is tell it which version of Rails to bundle with your app in the Gemfile: gem 'rails', '3.1'
. This works for any version, past or current. The only thing you have to worry about is the libraries like Ruby, but any version of Rails will work on most versions of Ruby. Plus, most hosts will even allow users on shared servers to compile your own Ruby if you want.
Hosts definitely support 'legacy' versions up to a point. I think even GitHub is on Rails 2.2, though they might be self-hosted.
Hosting tends not to be that big of a deal with respect to new rails versions, however. It's the community. Gems, plugins, and systems come in and out of fashion at blinding speed in the Rails community and you can quickly find yourself committed to a pile of unmaintained contributed code. Most new gems now ONLY support Rails 3, so if you have a 2.x.x app and want to use those things, you're SOL unless you backport it yourself.
So yes, you are chasing Rails versions over the long period. There's 2 ways to solve it: either walk away from every app you write after it's finished, like a consultant, or keep your app small. If you want to build a large, feature-filled platform, you can't build it as one app. You'll get stuck on a Rails version forever and have to rewrite it eventually anyway. Just set a threshold and say when this app is over 10,000 lines, it's time to break it up into services so it doesn't get fossilized.
精彩评论