-1

I built (hacked) my web app by extending Michael Hartl's Rails 3 tutorial, only to discover that my web hosting service requires Rails 2.3.8. I am a complete newbie to Ruby/Rails, and was wondering how feasible a downgrade from Rails 3.x to Rails 2.x would be.

Unfortunately my webhost is not able to upgrade to Rails 3.

Edit

To be more specific: my application is largely based on the tutorial mentioned above. I am looking to determine what type of effort is involved in downgrading the Rails 3 tutorial application into a Rails 2 application. I will try it out anyway, but due to my inexperience with Ruby / Rails, before I started I just wanted to get an idea of what to expect (i.e., if there will be a lot of syntax changes, or will I have to restructure the file directory, etc.)

ntaj
  • 311
  • 2
  • 21
  • 1
    What exactly is your question - is it feasible? As it is, this is an unanswerable question; we don't have your source code to see what exactly you're doing, and you've posted a link to a generic tutorial page. Please edit it to provide a lot more info, or it will likely be closed as either "not a real question" or "not constructive" (because it's a discussion/speculation/opinion type question, which is inappropriate here). Thanks. – Ken White Jun 22 '12 at 22:44
  • 7
    I respectfully submit that if your hosting provider is unable to provide you with a working Rails 3.x installation then it's time to look for another hosting provider. Rails 3 has been released for nearly two years. – Justin ᚅᚔᚈᚄᚒᚔ Jun 22 '12 at 22:49
  • @KenWhite My apologies for not being more specific. I have updated the question. This was just a general question to get an idea of how much effort would be required to downgrade Michael Hartl's Rails 3 tutorial app into Rails 2. Since my application is heavily based on the tutorial application and despite my lack of experience with Ruby/Rails, if it was simple enough to downgrade the tutorial app, I figured I would be able to downgrade my own application, otherwise I may need to look into other alternatives. Thanks for any help. – ntaj Jun 22 '12 at 23:48
  • The tutorial is geared specifically towards Rails 3, and there are enough differences that w/o experience, you'd be better served with a different approach. IMO the first option would be a more up-to-date host. – Dave Newton Jun 22 '12 at 23:51
  • Can you not just use bundler to use Rails 3, regardless of your host? If not, dump them. – x1a4 Jun 23 '12 at 03:48

3 Answers3

1

You do NOT want to do this, it's a really bad idea, You'll end up chasing your tail forever with weird error messages and when yuo ask about them you'll be a very unusual case.

Either

  • Find a host that support Rails 3, while you get ready for Rails 4 (tee-hee)
  • Seek out of of the (many) books on amazon or ebay that cater to rails 2 (still probably a majority at this point).
  • Use Heroku - many people are using Heroku to go live for free and then be low cost when more's needed.

The main thing here about rails is that the versions advance quickly - and the code structure changes a lot with each version. You have to work much harder to avoid technical debt than with other, more mature, technologies.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
0

Agree with the 'new host' suggestions. I haven't downgraded an app, but the upgrades I've done have taken weeks on large apps. So my answer is that it's not feasible enough for me to want to try, and I've been using Rails for years.

I've had a cheap Dreamhost account for years, and they stay up to date. I've also heard good things about bluehost. Note that both of these shared providers are "get what you pay for," but if you value your time, it's certainly worth $7 or whatever the monthly fee is to not spend your time downgrading the app.

Woahdae
  • 4,951
  • 2
  • 28
  • 26
0

It can be done though if that's what you really want. But it is a lot of work. I remember upgrading one very large app from rails 2 to rails 3. You will need to do this reversely. I had to solve gem compatibility(some gems only work with rails 3 and it might be harder to get support for rails 2 now), active record had a different API in the past versions, I'm not even sure if there was the chaining feature. E.g. instead of Model.where, you would often write Model.find(:conditions => {...}), if you're using generic ajax helpers(with :remote => true) that appeared in rails 3, then these would not work. Plus I would also scan the rails changelog for any security patches that were done in rails 3 just to be sure. Could be that you will have to tighten security on some places on your own in the older version. If you have your app test covered (and I hope you do :-)) than there might be some problems with older versions of rspec or cucumber but generally these were not so big. I think gem compatibility is the greatest issue. The rest is more or less mechanical work. Find and replace.

Good luck with that but as was said before, if you can switch your hosting then I advise to do so and stick to the latest version of rails.

Renra
  • 5,561
  • 3
  • 15
  • 17