Upgrading from Rails 2.1.0 to 3.0 the "right way" makes my head hurt

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
time.

On Fri, Mar 25, 2011 at 3:18 AM, sol.manager [email protected]
wrote:

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.

Before you jump to a new version, you should look for the gems you are
using
and see if there are any conflicting issues.

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?

No, its not required.
The main one is Rails 2.3.* to Rails 3.

On 03/24/2011 02:48 PM, sol.manager wrote:

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
time.

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.

Norm

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.)

Hey bros,

Use Ruby Version Manager.
It will make your life easier and productivity wise? You’re on it :wink:

Thanks!

Andre

On Mar 24, 5:48pm, “sol.manager” [email protected] wrote:

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.

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?

–Matt J.

+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

Thanks!

Andre

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.

When I change the Rails gem version from 2.2.2 to 2.3.4 and restart
the site, I get:
Error message:
undefined local variable or method `version_requirements’ for
#Rails::GemDependency:0x102b8d988
Exception class:
NameError

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.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/25/2011 11:22 AM, Paul wrote:

We have an app that is at Rails 2.1.0 and our web developer has let us

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.


Best Regards,

Adrian P.
http://www.adrianperez.org

Twitter: @blackxored | Skype: blackxored | Google Voice: (559) 744 3201
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAgAGBQJNjLRwAAoJEF9FgjLdFu0kiDoP/AxKNoiSjP5JbnogKg4KyHjc
wFrIa/vhnqpfDt3Kcpjc0B1fFEUZDFX8DqDo6oND8w5kzFcBcDj/ON3fHHT3TUkX
FpwAIH5eKVbxkG09PoB2+XDBM4/GJkibZaQpQGNz7DpqhdUjsaeV1HGqcUSfd35d
GZe6/SCj7r2H+XSm2HqKOCH7Ei0IBOIDna6KhUVXen52+zNkv1P86m2zkJeH4ZD/
Y8htU3QwdrhlBm36Fe1a6+qBaoSjKwkYhOyeHCad8bXE+wm969D5+v+1E7xXR685
d+1nS4mSZry6EGRsfydvjGJ3DksfE5IUlXunrOyOaUD28yaHBY1YYxbSWFiob60f
GPN4hWM2V+tc1bLeA7ugOTwWtOS4SLAAX0b00GbAnBi/dVjRNFsil+31EzQ3oOwQ
lTBUeoiFqZxal08IbRSYbgj/YK1Z1tqz9FHrxundKTbiYGsaobilYnRUM+CJmtSy
u0cTN1PJR2bvZnF+LssVOFKDFmveh8kdg6hSFS6uxjWjYn6ld6O7VfVyOV80V/45
7W281kpkI4j956gx7IM3X0VKWKCFJhvDyoMua7RI21550Of7kvu5NaVVDYqlpq/O
b5HZWt3cMR85edXnQiAuZ/gx0xJiEdZxZ39Mbg3JlNQop+/w6Op/dPu243Y8ushM
PQTeqLon28Bi7/lhpY+K
=ntoO
-----END PGP SIGNATURE-----

On Mar 25, 2:00pm, “sol.manager” [email protected] wrote:

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.

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).

–Matt J.

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs