Switching to Rails 2.1

Hi everyone.

Here is my problem:
I’ve been working on a RoR project for a while (its quite big
project), but have to stop the work on it for some half a year. Now
I’m back on it and I’d like to switch to the newest version of Rails
(my project is using Rails 1.2.6). Any tips how can this be done in
some painful fashion? Plus I would like to pick the Rails 2.1 on the
way as easily as possible. Any tips here, too?

On 21 Aug 2008, at 18:28, nightcoder wrote:

Hi everyone.

Here is my problem:
I’ve been working on a RoR project for a while (its quite big
project), but have to stop the work on it for some half a year. Now
I’m back on it and I’d like to switch to the newest version of Rails
(my project is using Rails 1.2.6). Any tips how can this be done in
some painful fashion? Plus I would like to pick the Rails 2.1 on the
way as easily as possible. Any tips here, too?

install the gems, change environment.rb to use the new ones. (or if
you’ve frozen rails into your project then just refreeze it).

Fred

Quoting nightcoder [email protected]:

Hi everyone.

Here is my problem:
I’ve been working on a RoR project for a while (its quite big
project), but have to stop the work on it for some half a year. Now
I’m back on it and I’d like to switch to the newest version of Rails
(my project is using Rails 1.2.6). Any tips how can this be done in
some painful fashion? Plus I would like to pick the Rails 2.1 on the
way as easily as possible. Any tips here, too?

I’d suggest moving to 2.0 first. It should be fairly painless since
your
project is already at. Deal with any deprecated warnings before moving
to
2.0. If you were using pagination, migrate to will_paginate as part of
the
move to 2.0. Run the automated tests, beat on it a few days, check
everything
into version control. Search out blogs on Rails 2.1; Google is your
friend.
I recommend the screen casts by Ryan B. at
Ruby on Rails Screencasts - RailsCasts and Riding Rails blog,
especially
Ruby on Rails — Rails 2.1: Time zones, dirty, caching, gem dependencies, caching, etc

HTH,
Jeffrey

Milan Novota wrote:

Here is my problem:
I’ve been working on a RoR project for a while (its quite big
project), but have to stop the work on it for some half a year. Now
I’m back on it and I’d like to switch to the newest version of Rails
(my project is using Rails 1.2.6). Any tips how can this be done in
some painful fashion? Plus I would like to pick the Rails 2.1 on the
way as easily as possible. Any tips here, too?

  • Switch to 2.1 (or 2.0, stepwise)
  • run all your tests
  • when a test fails, pass it
  • switch back to 1.2.6
    • revert your config/boot.rb
    • comment out the 2.1.0 line in config/environment.rb
    • integrate the new stuff in scripts and public*
  • pass all tests and integrate

Repeat until all tests pass in 2.1…

*except if you have a JS that requires an old version of prototype.js…


Phlip

Thank you both!

– Milan Novota

2008/8/22 Jeffrey L. Taylor [email protected]