Moving to Rails 1.2.2

Well today I have FINALLY moved all my three current Rails projects (the third one is still in development though) to Rails 1.2.2.

There were some quirks I had to resolve during the transition though.

First of all, I have installed the latest version of rails onto the server by typing:

gem install rails –include-dependencies

Then I have updated all of the gems to their latest versions:

gem update

Some changes had to be made to the source code of my Ruby apps:

  • @params and @headers are deprecated now, so I have renamed them to params and headers
  • in environment.rb I have replaced the old RAILS_GEM_VERSION = '1.6' to RAILS_GEM_VERSION = '1.2.2' unless defined? RAILS_GEM_VERSION
  • there was a problem links generated by image_tag / FlexImage's flex_image generated image formatting function not resolved by Rails routing because image_tag attached the ".png" extension (and Rails 1.2 has a stricter checking for filenames in routes, so /image/show/123 was resolved just fine, but /image/show/123.png was getting unknown_action , though it was not a problem with Rails 1.1.6). As a simple solution I have added the following to routes.rb :
    map.connect 'image/:action/:id.:ext', :controller => 'image'
  • I have removed "vendor/plugins/engines", "vendor/plugins/unicode_hacks" as they seem not to be compatible with Rails 1.2 (everything worked fine in development mode, but was giving errors in production)
  • as the last step, I ran "rake rails:update" to update JS libs and stuff to their latest version

Everything works fine nice, and feels a bit snappier even. Cool :)

3 Responses to “Moving to Rails 1.2.2”

  1. James Adam Says:

    You'll need to upgrade your engines plugin - see http://rails-engines.org for more details. The 1.2 release is fully Rails-1.2 compatible.

  2. mike Says:

    Thanks James! Looks like the rails-engines.org is down right now. I'll have a look at what the engines plugin does at all, since I don't remember installing it in the first place :) Though at the time I was installing everything I was still a very green Rails noob and didn't actually undrestood what I've been doing :))
    Anyway, removing the plugin didn't do any good or bad. Need to look at what it does exactly..

  3. MJmineta Says:

    good job!

Leave a Reply