Home > Ruby Rails > undefined method `manage_gems’ for Gem:Module (NoMethodError)

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

OK,  if you are looking for a solution to the above error hopefully this post might help you.  This happens normally if you upgrade your gems.

(Please note – I’m talking about ubuntu here, If you are on  windows then try Ubuntu :D)

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 done following and it worked for me. My solution was to create a symbolic between ‘gem’ file and ‘gem1.8’ file.

Here’s how I did it,

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

OK, now create the symbolic link

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

Thats it, now time something like

gem list and it should work.

Hope this quick note will help 😀

  1. stella
    April 25, 2010 at 2:25 pm

    thanks, it really helped 🙂

  2. Nivedita
    November 11, 2010 at 10:56 pm

    Thank you so much……It really helped me. I have literally wasted few hours in trying a solution for the error.

  3. Ratz
    December 17, 2010 at 10:31 am

    Just wanted to thank you for the useful instructions. Sure saved me hrs of head banging stress 😉 Appreciate it!

  4. Pragash
    January 9, 2011 at 4:18 am

    Thanks man, it worked for me.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: