Active Record Already Activated

Written on Monday, May 4th, 2009 at 1:06 am and is filed under Ruby on Rails.

After spending hours and hours staring at line after line of SSH into my MediaTemple Ruby On Rails Container, I finally found a solution for this stubborn error that kept developing in my mongrel log on application start:

/home/XXXXX/data/rubygems/lib/rubygems.rb:149:in `activate’: can’t activate activerecord (= 2.3.2, runtime), already activated activerecord-2.1.0 (Gem::Exception)

I have tried a whole slew of commands to try and fix this. First, I tried running:

gem cleanup

Still got that same error when I tried starting my application I made sure that my environment.rb was called the correct version of Rails that I had installed. This command seem to get me in the right direction:

rake rails:freeze:gems

Before running this, call the following code from your applications root directory:

rm -rf vendor/rails/

This will remove the folder “rails”, then you can continue with running the rake command. After running rake freeze, I got an error, saying it couldn’t find any rake files. I got this output:

Freezing to the gems for Rails 2.3.2
rm -rf vendor/rails
mkdir -p vendor/rails
cd vendor/rails
ERROR: Gem ‘activesupport’ not installed.
mv activesupport
rm -rf vendor/rails
rake aborted!
undefined method `to_str’ for nil:NilClass

Specifying a version to the rake freeze command this work like a charm, I simply ran:

rake rails:freeze:edge RELEASE=2.1.2

Started my application, checked my mongrel log, no errors on start up. I browsed to my URL and it worked. Hopefully this can help you fix your problem and relieve any headaches. If I missed anything that can help other people out, let me know. The joys of coding continue…

Spread the ♥

  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Mixx
  • Google Bookmarks
  • email
  • Reddit
  • Design Float
  • StumbleUpon
  • Technorati

other related posts...

  1. Installing Ruby on Rails Plugins via MediaTemple
  2. Validating with Rails
  3. Cracking down with Ruby on Rails

Take a peak at some more?

Leave a Reply