Ruby on Rails version 2.2

I have been very delinquent in posting to this blog. Fatherhood plus several big projects have forced me to put it on the back burner. I’m hoping to resume regular blogging in January.

But until then, I do want let everyone know that Rails 2.2.2 is out. Here’s the announcement. There are lots of new features that make the upgrade worthwhile.

A few notes about upgrading though. You need RubyGems 1.3.1 first. Here’s how I upgraded RubyGems, including the error I got while trying.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
>gem -v
1.2.0

>sudo gem update --system
...
ERROR:  While executing gem ... (NameError)
    undefined local variable or method 'remote_gemspecs' for
#<Gem::Commands::UpdateCommand:0x14a5744>

(if you get the same error, try this instead)
>sudo update_rubygems
...
RubyGems installed the following executables:
    /usr/local/bin/gem

>gem -v
1.3.1

(and then either...)

>sudo gem update
(which updates ALL gems not just Rails, or)

>gem install rails
(which updates just Rails)

>gem list --local
(shows you a list of all currently installed gems and all versions installed)

>sudo gem cleanup
(once you are 100% sure you want to erase old versions of ALL gems, not just Rails)

Next, edit the /config/environment.rb file in each of your Rails applications so that RAILS_GEM_VERSION is 2.2.2. Now you application will demand the new Rails version. (Even if you didn’t do a “gem cleanup” and still kept the old version installed. As long as you have both versions of the Rails gem, you can have some applications loading up 2.2 while others use still use the old Rails version.)

Then from the root of each of your Rails applications, you can run rake rails:update to update the application to the new version. (Never a bad idea to make a backup copy first.) What does that update change? It may depend on your current Rails version, but for me, it updated the default JavaScript files and also /config/boot.rb.

Bookmark and Share

5 Responses to “Ruby on Rails version 2.2”

  1. erfon Says:

    Hey Kevin, really enjoying going through your lynda tutorials, great work on those.

    I was curious though, do you know if lynda is planning on updating them for rails 2? It’s been a bit tricky following through some parts of the tutorials since I’m using v2.2. I thought about using the older version of rails, but I don’t want use deprecated code…

    thanks!
    erfon

  2. Kevin Skoglund Says:

    Yes, they are being updated: for Rails v3 which is due out later this spring.

  3. erfon Says:

    That’s cool. I’m definitely going through those the MINUTE they come out before they get outdated!

    Can we expect to hear your friendly voice on those tutorials?

    thanks

    erfon

  4. Kevin Skoglund Says:

    Yes, updated by me. :-)

  5. erfon Says:

    Hey Kevin, I’ve been keeping my eye out for the updated lynda RoR tutorials but haven’t seen them yet. Just curious if you knew about when lynda was planning on releasing them?

    thanks

Leave a Reply