1

I somehow screwed up my ruby installation. It says:

ruby ....
/Library/Ruby/Site/2.0.0/rubygems.rb:1098:in `register_default_spec': undefined method `default_gems_use_full_paths?' for Gem:Module (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:699:in `block in load_defaults'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:647:in `block (2 levels) in each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in `block in each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in `each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:653:in `each_default'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:698:in `load_defaults'
from /Library/Ruby/Site/2.0.0/rubygems.rb:1239:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'

I updated all gems or something that like. How can I revert to the original ruby installation? I guess I have a timemachine backup, but maybe a clean reinstall is better.

Edit: OK, I deleted the gems as suggested in an answer, but when I try to reinstall them, I get:

gem install flickraw
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems /core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/util (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems.rb:527:in `gunzip'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/remote_fetcher.rb:275:in `fetch_path'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/remote_fetcher.rb:304:in `cache_update_path'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/source.rb:130:in `load_specs'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/spec_fetcher.rb:230:in `tuples_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/spec_fetcher.rb:199:in `block in available_specs'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/source_list.rb:55:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/source_list.rb:55:in `each_source'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/spec_fetcher.rb:195:in `available_specs'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/spec_fetcher.rb:81:in `search_for_dependency'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/spec_fetcher.rb:139:in `spec_for_dependency'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:156:in `find_gems_with_sources'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:303:in `find_spec_by_name_and_version'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:109:in `available_set_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:329:in `install'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/commands/install_command.rb:166:in `block in execute'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/commands/install_command.rb:158:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/commands/install_command.rb:158:in `execute'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/command_manager.rb:170:in `process_args'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/command_manager.rb:130:in `run'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:60:in `run'
from /usr/bin/gem:21:in `<main>'
  • OK, Edit was silly, I had to install as root. But after installing as root, the programms could not read the gem, so I had to change the permissions in /Library/Ruby/Gems/#num by hand. Now everything works. Thanks! – Stefan Müller Feb 1 '15 at 7:52
3

You should be able to clean up all of your Ruby gems with this Terminal command:

sudo rm -rf /Library/Ruby/Gems/#num

Where #num is your installed Ruby version (for Yosemite and Mavericks, that should be 2.0, and for Snow Leapard, Lion, and Mountain Lion, it should be 1.8).

It should also keep all system-provided gems intact, which is a good thing, because some applications may require them.

  • Thanks, I deleted them, but seem not to be able to add new ones. – Stefan Müller Jan 31 '15 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .