axonflux.posterous.com, a new posterous blog on Rails, scaling, and software engineering. First, upgrading to Rails 2.2.2

Hi there. There's a lot of magic in Rails, and as someone who works with it daily, it is absolutely amazing to see how valuable Google is to wading through the magic. I don't know what I would do without the help afforded me by the awesomeness of great Rails bloggers and the help of forums, so I figure here's my little contribution into the ether.

 

On plugins that broke
  • acts_as_paranoid ceased to work for me as of Rails 2.1.2. There was too much magic and it was really gumming up our MySQL indexes, so we killed it. One less where clause to worry about, and that's priceless when it comes to MySQL optimization.
  • xss_terminate needed an upgrade. no big deal there.
  • We use workling and starling in our stage/production environments, but workling and spawn in development. Connection pooling broke spawn, but I submitted a patch for Rails 2.2.2 so it's back in business again. Workling is the superb work of Rany Keddo of play/type -- great piece of software, by the way.
  • The rubyforge plugin continues to not play nicely with the AWS S3 gem, causing errors with 'tmp_dh_callback' -- but a simple plugin patch solves that quite elegantly.

 

Upgrading to RubyGems 1.3.1

You'd think that running gem update --system would do it, but you'd be wrong.

On ubuntu and OS X, you gotta run this:

sudo gem install rubygems-update
sudo update_rubygems

Thanks to intertwingly

 

Also, on freezing native gems...

I tried to be smart and do a rake gems:unpack and rake gems:unpack:dependencies, but unfortunately for me, rake gems:build fails on Ubuntu. It failed specifically on hpricot, eventmachine and json gems, all of which had native extensions.

I just dropped those into my config.gems instead, and made sure to run rake gems:install on the stage/production servers after deploy.

 

And a quick note on the importance of tests...

Every Rails update has significant impact on the rest of your app. Unit and integration tests are critical for being able to catch these bugs without resorting to manual testing... but that'll be a future blog post.