/usr/bin/gem:4: undefined method `manage_gems’ for Gem:Module (NoMethodError)


Error Symtom: When you try to install $gem install rails or $gem update you get an error message ” /usr/bin/gem:4: undefined method `manage_gems’ for Gem:Module (NoMethodError)”.

Solution:

Step 1: $sudo vim /usr/bin/gem

Step 2: Search “Gem.manage_gems” and remove it or replace it or comment with #Gem.manage_gems in the gem file

Step 3: Insert a file require ‘rubygems/gem_runner’ so that the first lines of /usr/bin/gem look like this
 
require ‘rubygems’
require ‘rubygems/gem_runner’
#Gem.manage_gems

Now the problem fixed.

Ref: http://www.videc.at/2009/04/30/rubygems-undefined-method-manage_gems-for-gemmodule-nomethoderror/

 

Leave a comment