How To Upgrade to Rails 2.0 from 1.2.5

I had to upgrade my Rails app last night to 2.0.2 from 1.2.5. This is a brief overview of what it took to make it happen. I'll write some other posts soon with more details. A little background: I'm using InstantRails and the Aptana RadRails IDE on Windows XP SP2.

Here's what I did:


  • Installed Instant Rails 2.0.

  • Checked out a working copy of my code from SVN

  • Updated environments.rb: RAILS_GEM_VERSION = '2.0.2'

  • Fired it up: didn't work.

  • I'm using acts_as_tree and acts_as_list, so I needed to install those plugins.

  • Fired it up: didn't work.

  • I'm also using Comatose, and there was an error with the "template_root". Bottom line: after reading some message boards, etc. I removed and reinstalled the Comatose plugin and that fixed it.

  • Fired it up: didn't work.

  • Was getting this error:

    Status: 500 Internal Server Error
    A secret is required to generate an integrity hash for cookie session data. Us
    e config.action_controller.session = { :session_key => "_myapp_session", :secret
    => "some secret phrase of at least 30 characters" } in config/environment.rb


    Well, that message says it all, so I changed that.

  • Fired it up: was working. Now, navigated my app...errors.

  • Had to change ':dependent => true' to ':dependent => :destroy'

  • Removed the line(s) config/environments/development.rb:12: config.breakpoint_server = true
    from configuration since the setting has no effect anymore.
    Instead, start `script/server` with the "-u" or "--debugger" option (or "-h"
    to see all the options). This wasn't causing an error, but while trying to figure out the dependent => :destroy thing, I read it on someone's blog, so I removed it.

  • Also, had to install the classic_pagination plugin. (Really, every blog out there says I should upgrade to will_paginate, but my blog is about progress vs. perfection. Old school pagination works for me for now, so I'll stick with it.)

  • Fired it up...everything running, but still some functionality isn't working. (Gee...I wish I'd writen *all* the unit tests. Okay, let's debug.)

  • Opened RadRails, imported existing directory into a project.

  • Got this error: rad rails "Cannot find gem for Rails ~>2.0.2.0:"...had to switch workspace because I installed the new Instant Rails and RadRails was still pointing at the old one. (Not an issue if you overwrite, but I'm running my concurrently.)

  • Hmmm...the server runs through Aptana RadRails, but debugger is slow as heck...turns out that I updated ruby-debug-ide when I updated gems and that un-checked the checkbox for using the fast debugger in the IDE. Also, had to install ruby-debug-base. (I don't think this was required before, but once I installed it the debugger worked.)


Whew, well, I haven't found my bug yet, but that's how far I've progressed. Hopefully this will help the next guy out.