views:

135

answers:

2

When I try to update rubygems (by running 'gem update --system') I get this error:

ERROR:  While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

Any idea what might be wrong and how I can fix it?

A: 

Just from reading the error message, I'd suggest updating RubyGems via apt (sudo apt-get install rubygems) instead of from within RubyGems.

Doches
Just tried that but I seem to have the same version of rubygems as before (1.3.5)
585connor
That's probably because debian hasn't update rubygems yet. Debian is known to be very thorough before going to a new version of a package. You can try install it manually like in my answer.
jigfox
+3  A: 

There are two ways: get rid of the debian ruby package and install ruby from source, or you can follow the instrucions given to you:

RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

the rubygems with debian is managed by apt, and so you need to update it with it. If you don't want to, you need to install ruby on you own, without using apt. Or at least you need to install ruby-gems on you own. Try this:

[sudo] apt-get remove rubygems
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xzf rubygems-1.3.7.tgz
cd rubygems-1.3.7
[sudo] ruby setup.rb
jigfox
Thanks, I think this is the way to go for me. I have a few rails apps I'm working on, how will they be affected by this?
585connor
It's possible that you need to reinstall all required gems, but other than this, there shouldn't be any side effects.
jigfox