Thursday, December 8, 2011

undefined method 'manage_gems’ for Gem:Module (NoMethodError)

Then ruby gems will create a new file called 'gem1.8' and it will conflict with your older 'gem' file. You can find both these files in /usr/bin

So when ever you say gem list (or something with gem) it gives the error '/usr/bin/gem:11: undefined method 'manage_gems' for Gem:Module (NoMethodError)'

As a workaround,  I have followed the below steps and it worked for me. My solution was to create a symbolic between 'gem' file and 'gem1.8' file.

Steps:

first copy your 'gem' file (as a backup)

cp /usr/bin/gem /<my other path>/

Now delete the 'gem' file

sudo rm -f /usr/bin/gem

Now create the symbolic link

ln -s /usr/bin/gem1.8 /usr/bin/gem

Thats it, now run gem list and it should work.

No comments:

Post a Comment