Photo-1 Photo-2 Photo-3 Photo-4 Photo-5 Photo-6

@brentmc79

@brentmc79

Full-time web developer. Part-time smart ass.

I'm Brent Collier.

After a year and a half as an engineer on Twitter's Trust & Safety team, I'm looking for my next gig. Contact me if you know of something interesting.

#

Having trouble updating rails?

Posted on 06/18/2008

I was setting up the AAB dev environment on my macbook pro when I realized that I was only running Rails 2.0.2 but AAB wanted 2.1.0.  Ehh...  no big deal I thought.  I opened up Terminal and typed...

$ sudo gem update rails

All the usual output scrolled by, indicating that everything went as expected.  Once it was done I tried to check the rails version and that's when I realized that there was a problem

$ rails -v
/Library/Ruby/Site/1.8/rubygems.rb:377:in `report_activate_error':
RubyGem version error: activesupport(2.0.2 not = 2.1.0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:309:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:335:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:334:in `each'
from /Library/Ruby/Site/1.8/rubygems.rb:334:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:76:in
`active_gem_with_options'
from /Library/Ruby/Site/1.8/rubygems.rb:50:in `gem'
from /Library/Ruby/bin/rails:15

So then I ran 'gem list' and saw what was up.

...
actionmailer (2.0.2, 1.3.6, 1.3.3, 1.2.5)
actionpack (2.0.2, 1.13.6, 1.13.3)
actionwebservice (1.2.6, 1.2.3, 1.1.6)
activemerchant (1.1.0)
activerecord (2.0.2, 1.15.6, 1.15.3)
activeresource (2.0.2)
activesupport (2.0.2, 1.4.4, 1.4.2)
...

When I did the rails update, none of the rails dependencies were updated.  I tried the update again, thinking that maybe something had just choked in the process, but it was no luck.  A quick Google search yielded the solution of using update with the --source option and http://gems.rubyonrails.org as the URL.

$ sudo gem update --source http://gems.rubyonrails.org
Updating installed gems
Updating metadata for 13 gems from http://gems.rubyonrails.org/
.............
complete
Updating actionmailer
Updating metadata for 13 gems from http://gems.rubyonrails.org/
.............
complete
Successfully installed activesupport-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Updating activerecord
Successfully installed activesupport-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activerecord-2.1.0
Updating activeresource
Successfully installed activesupport-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activerecord-2.1.0
Successfully installed activeresource-2.1.0
Gems updated: activesupport, actionpack, actionmailer, activesupport, actionpack, actionmailer, activerecord, activesupport, actionpack, actionmailer, activerecord, activeresource

That did it! Now rails and all its dependencies are at 2.1.0.