Journal Friends Archive Profile Memories Chalain Apr. 30th, 2008 04:12 pm What to do when gems.github.com breaks gems FOREVAR UPGRADE YOUR GEM SYSTEM TO V 1.1.1 BEFORE ADDING gems.github.com TO YOUR SOURCES!!!



That is the message that needs to be displayed in an H1 tag across gems.github.com, not some tiny note saying "if you get this error, you should" and then a message that essentially amounts to "go back in time and not have done this." They'll tell you to update your gem system, but if you're experiencing the problem, gem can't update itself.



For those of you lacking time machines, you need to remove github.com from your gem sources so the system update will run. The command to remove a source is not documented anywhere¹, but if you promise not to tell anyone, here it is: sudo gem sources -r http://gems.github.com/ Once you've done this you can now do sudo gem update --system sudo gem sources -a http://gems.github.com/ and you're back in business.



¹ EDIT: A reader pointed out that it IS documented. "gem help sources" will get you what you need, and "gem help commands" is listed from the main "gem help" screen so you can navigate to it. Thanks! Current Music: No One Like You - Scorpions

12 comments - Leave a comment From: (Anonymous) Date: April 30th, 2008 11:29 pm (UTC) Updated instructions (Link) Updated instructions are now up at http://gems.github.com



Hope this helps the confusion. Reply ) ( Thread From: chalain Date: April 30th, 2008 11:38 pm (UTC) Re: Updated instructions (Link) UGH. Now it's worse.



They've removed any hint or indication of what might be wrong if you made the mistake of installing sources without upgrading gems. Granted, for people who haven't installed this, the instructions are better. But for those who are already broken, they've removed what little lifeline/hint was already there.



This is EPIC FAIL, guys. There's no indication that not following these directions precisely WILL BREAK YOUR GEMS INSTALLATION COMPLETELY. Reply ) ( Parent ) ( Thread From: chalain Date: April 30th, 2008 11:48 pm (UTC) Re: Updated instructions (Link) Don't get me wrong. I love git and I really like what the guys at github are doing. This isn't their fault, this isn't really their problem to fix, and I certainly don't think they need to document every possible thing that could go wrong if you do something other than what they tell you.



But.



I lost 2 hours to this today because:



a) this open manhole cover wasn't labeled with any kind of warning,

b) the mechanism for getting out of the manhole was added recently to gems and the public docco for it has not yet been updated, and

c) the error messages I was getting didn't even indicate that I'd fallen into a manhole in the first place



Anyway. The new instructions are good, yes. Hopefully anybody who's already broken their gems install will find this blog post. Reply ) ( Parent ) ( Thread From: ext_98001 Date: May 1st, 2008 07:28 am (UTC) Re: Updated instructions (Link) Thanks so much for pointing out how to fix this problem. I was wondering why rubygems wasn't able to find every gem I was trying to install. Reply ) ( Parent ) ( Thread From: (Anonymous) Date: May 1st, 2008 12:17 am (UTC) Thanks (Link) Red letters, all caps... got the message :-)



Much appreciated. Reply ) ( Thread From: (Anonymous) Date: May 1st, 2008 10:04 am (UTC) (Link)



o rly?



# gem help sources Usage: gem sources [options] Options: -a, --add SOURCE_URI Add source -l, --list List sources -r, --remove SOURCE_URI Remove source -u, --update Update source cache -c, --clear-all Remove all sources (clear the cache) "The command to remove a source is not documented anywhere"o rly? Reply ) ( Thread From: chalain Date: May 1st, 2008 06:25 pm (UTC) (Link) Ah, good spot. I did a "gem help" which did not list sources at all. It did not occur to me to try "gem help sources", or even "gem help commands", which IS listed on gem help.



Thanks! Reply ) ( Parent ) ( Thread From: jfargo Date: May 4th, 2008 11:31 pm (UTC) (Link) *nods sagely* I'll remember that.



If it ever comes up.



Which it won't, because of this time machine.



You think I'm kidding? Watch, I'll go back and influence things so that I move to Delaware in November of last year. I will! Reply ) ( Thread From: chalain Date: May 5th, 2008 03:44 pm (UTC) (Link) Ha. If you really had a time machine, you'd be able to stop me from--hang on, there's somebody at the door. Reply ) ( Parent ) ( Thread From: (Anonymous) Date: May 8th, 2008 12:22 pm (UTC) I'm still having issues - can you help? (Link) This all started when I did gem sources -r http://gems.github.com. I have removed it then tried your directions but I still cannot install any gems. Can you help?



D:\My Documents\code>gem sources -r http://gems.github.com

source http://gems.github.com not present in cache



D:\My Documents\code>gem update --system

Updating RubyGems

Bulk updating Gem source index for: http://gems.rubyforge.org/

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

Nothing to update



D:\My Documents\code>gem -v

1.1.0



D:\My Documents\code>gem sources -a http://gems.github.com

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

Bulk updating Gem source index for: http://gems.rubyforge.org/

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

http://gems.github.com added to sources



D:\My Documents\code>gem install mislav-will_paginate

Bulk updating Gem source index for: http://gems.rubyforge.org/

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

Updating metadata for 123 gems from http://gems.github.com/

................................................................................

...........................................

complete

ERROR: could not find mislav-will_paginate locally or in a repository Reply ) ( Thread From: chalain Date: May 8th, 2008 03:38 pm (UTC) Re: I'm still having issues - can you help? (Link) D:\My Documents\code>gem sources -r http://gems.github.com

source http://gems.github.com not present in cache



You didn't actually remove it, that's why the problem is persisting. Try "gem sources --list" to see which sources you have.



Chances are you have "



Good luck! You didn't actually remove it, that's why the problem is persisting. Try "gem sources --list" to see which sources you have.Chances are you have " http://gems.github.com/ " in there (note trailing slash).Good luck! Reply ) ( Parent ) ( Thread From: (Anonymous) Date: May 8th, 2008 08:57 pm (UTC) Re: I'm still having issues - can you help? (Link) Yes, you were correct. I did find that earlier, but I removed it and still can't update to 1.1.1. Any more ideas?



C:\Documents and Settings\Mike>gem sources --list

*** CURRENT SOURCES ***



http://gems.rubyforge.org

C:\Documents and Settings\Mike>gem update --system

Updating RubyGems

Updating metadata for 2 gems from http://gems.rubyforge.org/

..

complete

Nothing to update



C:\Documents and Settings\Mike>gem -v

1.1.0

Reply ) ( Parent ) ( Thread