Thursday, March 31, 2011

Ruby Gems 1.6.0 and Rails 2.x - uninitialized constant ActiveSupport::Dependencies::Mutex

If you're like me and you have some older Rails 2.x applications or even prefer to stay on Rails 2.x you might have run across this problem.  I was trying to deploy a Rails 2.3.5 application on one of my Linode virtual servers and received the following error.

uninitialized constant ActiveSupport::Dependencies::Mutex

Fortunately there are a couple places to find information on this error.  Unfortunately most of the suggested fixes were not working for me.   The suggested fixes involved requiring "thread" in just about every place imaginable but that did not resolve the issue for me.  I was running Rails 2.3.5 and RubyGems was 1.6.2 which apparently just wasn't going to work.  I choose to upgrade to Rails 2.3.11 because of this post that suggested it was going to fix my problem.  Moving to Rails 2.3.11 was the only way to resolve the issue for my setup.  If you're having the same problem you'll want to try the steps listed in the "Fixing Rails" heading on that post.

References
Ruby Gems 1.6.0 release notes 
Fixing Rails - Suggestion that fixed this problem