We have an app that is at Rails 2.1.0 and our web developer has let us
know going to 3.0 will cost some money. I have embarked on a personal
project to see what is involved in getting from 2.1.0 to 3.0. I have
the app up and running on 2.2.2 (with some fun along the way) and now
tried to get 2.3.4 and see a gem_dependency conflict type issue.
On my system I have rails (3.0.5, 3.0.3, 3.0.1, 3.0.0, 2.3.8, 2.3.5,
2.3.4, 2.2.2, 2.1.0, 1.2.6)
Do I really need to upgrade each step in-between, including
downloading Rails 2.x releases I missed? Is there some reason jumping
straight to 3.0 isn't recommended because it looks like it will take
me awhile if I have to go through each iteration. I am late to the
party, so I am encountering issues long since resolved for others, one
by one and having to learn/work my way through the mess at the same
Going from 2.1 to 3.0 is a long jump. I would go to 2.2.2 and then 2.3.11 and then 3.0. It is not required but it would give you smaller bites to fix at each increment and probably some deprecations to help figure out what needs to be changed. Make sure the tests and the app all work at each step whatever steps you take.
Use Ruby Version Manager.
It will make your life easier and productivity wise? You're on it
RVM gemsets will help you manage multiple versions of Rails on a single system, but the real problem you have is managing the risk that something in your app will be broken by the upgrade. If you’ve got reasonable test coverage on your application, you’ll probably be able to shortcut the process and skip past most of the patch releases. (Until something spectacularly fails, at least.)
You don't need to hit all the intermediate releases, but there are
some bumpy spots in the gem dependency manager in 2.x. What error
message are you getting?
I don't know if this is feasable in your case, but I'd be tempted to
start a brand new project in Rails 3, try to get the Gemfile correct
and work out problems there, generate scaffolding for all your
controllers, etc, from scratch, then use a diff tool to move your
existing code into the new files.
I'd rather go forward to 2.3.11 first. It's actually recommended to do
it that way. After you've been there, you can start thinking about rails
3, not before. Hope it helps.
Twitter: @blackxored | Skype: blackxored | Google Voice: (559) 744 3201
+1 on this, me too, i thought I can upgrade easily but it's different so I used RVM.
So from 2.3.8 to 3.0.1 rails using RVM
When I change the Rails gem version from 2.2.2 to 2.3.4 and restart
the site, I get:
undefined local variable or method `version_requirements' for
I did some investigating and realized that on my system I cannot
generate a new app in 2.3.4, 2.3.5 or 2.3.8, but I can in 2.2.2,
2.3.11 and of course 3.0.x. From my limited understanding there is a
conflict with the version of rubygems for these. I did an experiment
and jumped from 2.2.2 to 2.3.11 and this error disappears (to be
replaced with a different one). This is why I am trying to see what
versions I can skip over.
I have been debating this same thing. There are so many changes that
have been made since our site was first built (late 2006) that I
almost wonder if starting a clean site from blank, fixing all the gems
that need replacing, replacing test with Rspec and then regenerating
the models, controllers and views would work. I am trying to learn
Rails, Ruby and the whole thing all at once. I find that Rails 3 is
much friendlier to a noob like myself and it is frustrating to spend
time learning deprecated methods of doing things when I could benefit
from knowing the current way things are done. Both are a lot of work,
but rebuilding the site in 3.0 and making it functional with newer
gems is tempting.
Right now, I am learning a lot about why our 2.1.0 site will break.
From obsolete gems to deprecated code, tests that need to be updated
to match migrations to the tables, etc... It all makes my head hurt.
Yep, Rubygems deprecated the version_requirements method a while back
and then dropped it in the last month or so. I'd recommend you skip
the versions that don't work, or figure out how to get a <1.6 version
of Rubygems running (not recommended).