ERROR: could not find gem XXX locally or in a repository

何らかの原因で、gemが一切使えなくなったときの対処法。

# gem install XXX
ERROR:  could not find gem XXX locally or in a repository


ソースクリアすればいいらしい。

# gem sources -c
*** Removed specs cache ***
*** Removed user source cache ***
*** Removed latest user source cache ***
*** Removed system source cache ***
*** Removed latest system source cache ***