# How to upgrade an existing application to 2.2.2?

**URL:** <https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222>\
**Category:** Rails\
**Created:** [December 9, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222 "2008-12-09T16:31:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 9, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222/1 "2008-12-09T16:31:45Z")

</div>

I apologize for asking such a basic question, but I have a RoR  
application I  
started developing last July and would like to continue working on it  
now.  
Since that time, I have updated my rails version to 2.2.2 and, since I  
really don’t have anything to lose, would like to update this  
(previously  
2.1.0) application to 2.2.2.

I tried running:

$ rake rails:upgrade

and nothing happened (as verified by git)

So then I tried editing config/environment.rb and changing  
RAILS\_GEM\_VERSION  
to 2.2.2 and then running:

$ rake rails:upgrade

and now things have changed.

Is it really as simple as that?

Where should I have looked for documentation about this? (If such  
documentation doesn’t exist, I would be glad to add it, but I fear that  
it  
would be as simple as the 2 sentences shown above.)

–wpd

---

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 9, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222/2 "2008-12-09T16:39:23Z")

</div>

Hi Patrick,

what does your tests/specs tell you? Do they pass?

Regards  
Nicolai

---

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 9, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222/3 "2008-12-09T16:39:59Z")

</div>

Make that “What Do your tests/spec tell you?”…

Sorry about that.

2008/12/9 Codeblogger [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 9, 2008, 7:37pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222/4 "2008-12-09T19:37:17Z")

</div>

$ rake -T rails

shows an update task but not an upgrade one (in my 2.1.1 app). The  
rails:update task only updates “configs, scripts and public/javascripts  
from  
Rails.” It doesn’t update Rails itself. If you have Rails in  
vendor/rails,  
then you’ll have to replace that w/ 2.2.2. If you’re depending on gems,  
then  
it should be as easy as setting RAILS\_GEM\_VERSION and running rake  
rails:update. Now, that doesn’t mean that your app will work or your  
tests/specs will pass. You may have to make some changes.

Regards,  
Craig

---

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 9, 2008, 9:16pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222/5 "2008-12-09T21:16:50Z")

</div>

On Tue, Dec 9, 2008 at 10:38 AM, Codeblogger [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi Patrick,
> 
> what do your tests/specs tell you? Do they pass?
> 
> I forgot to mention that all of the tests pass before and after running the

$ rake rails:update

The main reason that I forgot to mention that was that, ummm… erhhh…  
Well, you see, at the time I wrote that, it wasn’t strictly true. But  
now  
it is 🙂

And yes, Craig, that should have been “rake rails:update” not “rake  
rails:upgrade”… that was a silly typo on my part. Also, I had  
previously  
used gem to update my rails installation.

So now, I would like to go add a page to the Wiki that says something  
like:

If you want to update to a newer version of Rails, here is what you  
should  
do:

1. Run “rake test” and make sure that all of your tests pass.
2. Ensure that you have the newer version of Rails installed (e.g. via  
“gem  
update”)
3. Check in your code using your favorite SCMS.
4. Edit config/environment.rb and set RAILS\_GEM\_VERSION to match the  
version  
of Rails to which you wish to update
5. run “rake update” to update the configuration files (such as boot.rb  
and  
environment.rb), scripts, and javascript files to reflect the newer  
version  
of Rails.
6. run “rake test” to make sure that all of your tests still pass
7. Fire up your browser and make sure things look “normal” (for suitable  
definition of “normal”).

Does this sound about right to folks? Is there any reason (within  
reason)  
that this same procedure couldn’t be used to downgrade an application  
(say,  
for example, if you wanted to use a plugin that only worked with 2.1.0,  
and  
you had been developing in 2.2.2)? I wouldn’t expect it to work to  
switch  
from 2.2.2 to, say, 0.3.1, but it seems like it ought to work for  
anything  
in the 2.x.y series.

–wpd

---

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [January 7, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/how-to-upgrade-an-existing-application-to-2-2-2/155222/6 "2009-01-07T17:17:49Z")

</div>

> of Rails to which you wish to update  
> you had been developing in 2.2.2)? I wouldn’t expect it to work to switch  
> from 2.2.2 to, say, 0.3.1, but it seems like it ought to work for anything  
> in the 2.x.y series.
> 
> –wpd

Worked out perfect for me. I updated a Rails 2.1 (Restful  
Authentication with all the bells and whistles (new 9/05/08)) app to  
enable ActiveScaffolding (which works only on rails 2.2. Tnx.
