RubyGems: undefined method ‘manage_gems’ for Gem:Module (NoMethodError)

Update: There’s a more efficient solution to this problem here: The Easy Fix

After updating RubyGems I got the following error message:

/usr/bin/gem:10: undefined method `manage_gems' for Gem:Module (NoMethodError)

Nice. So I took a look at the output that was generated and came across this:

Deprecation Notices:

* Gem::manage_gems has been removed.
* Time::today will be removed in RubyGems 1.4.

Now what? Right – fix it.

sudo vim /usr/bin/gem

Search “Gem.manage_gems” and remove it or replace it with


Unfortunately i got this

/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)

when running the gems command. After “googling” I came up with this: ¬†

sudo vim /usr/bin/gem


require 'rubygems/gem_runner'

so that the first lines of /usr/bin/gem look like this 

require 'rubygems'
require 'rubygems/gem_runner'


  • Sebastian

    First of all thanks for the post. Your fix solved my problem at first, but…

    when trying to install rsruby using

    gem install rsruby — –with-R-lib=/usr/lib/R/lib/ –with-R-include=/usr/share/R/include

    I ran into some serious problems – not sure if your fix or a mistake by me applying the fix was the problem – Gem ignored all parameters after “–” so I couldn’t build the native extension because it didn’t find R.h or (ok this is very specific, but hopefully it will help someone someday)

    I suggest to use the fix of Adam DiCarlo or as a quick fix just paste this into your /usr/bin/gem

    #! /usr/bin/ruby1.8
    # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
    # All rights reserved.
    # See LICENSE.txt for permissions.

    require ‘rubygems’
    require ‘rubygems/gem_runner’

    required_version =“>= 1.8.0”)
    unless required_version.satisfied_by?(
    puts “Expected Ruby Version #{required_version}, was #{RUBY_VERSION}”

    # We need to preserve the original ARGV to use for passing gem options
    # to source gems. If there is a — in the line, strip all options after
    # it…its for the source building process.

    args = ARGV.clone

    begin args
    rescue Gem::SystemExitException => e
    exit e.exit_code

    This code contains some parts from another gem installation and it worked fine for me.


  • Michael Mahemoff

    Marcel’s fix worked for me.

  • Casey Davis

    Thank you very much; I was just about to get really frustrated, and I’m not a *nix novice either. very helpful!

  • Don

    cheers. great.

  • Nicolas Goles

    Thanks for this :-)

  • Forrest Zeisler

    Your a life saver!

  • eveevans

    thats exactly what i was searching for

    and it fixed my issue :)

  • Kris Kemper

    I just wanted to note that I got this error when trying to do a ‘rake rails:freeze:gems’. Another blog out there recommended doing a ‘rake rails:unfreeze’ to fix the problem. In my case, that was all that was needed.

  • jgonzalez

    THANK YOU!!!

  • http://Website Dave

    Nice work, thanks.

    On a more serious note, why does this problem exist in the first place?? Unprofessional.

  • Nick

    Awesome, thanks for the fix!

  • http://Website Cristiano Amaral

    Valeu, matou a pau!

  • http://Website Andy

    Awesome, nice fix!

  • Pingback: /usr/bin/gem:4: undefined method `manage_gems’ for Gem:Module (NoMethodError) « My Blog()

  • http://Website fina

    thanks :)