"Cannot Load Such File - Rubygems/Defaults/Operating_System" When Installing Ruby 2.0.0

cannot load such file -- rubygems/defaults/operating_system when installing Ruby 2.0.0

Try installing Ruby using the --rubygems ignore option:

$ rvm install ruby-2.0.0 --rubygems ignore

Installation of rubygems fails when trying to install Ruby 2.0.0 with RVM

Well, I finally managed to fix it! Sorry if I ended up polluting SO. I'll reply to my question anyway in case somebody runs into similar problems and ends up here in the future.

It turned out I had a messed up installation of libyaml, "Installed but not linked", according to Homebrew. I figured it out after trying this solution. So I uninstalled libyaml and killed it with sudo rm -rf and installed it again. I ran into this problem but the accepted answer solved it. After this I installed RVM from scratch with stable ruby and it finally worked!

Something wrong with my ruby

The system ruby installation seems to be messed up. Try removing the offending /Library/Ruby/Site/2.0.0/rubygems.rb (and may be more of enclosing folders)

Ruby have its bundled rubygems at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0 so it should work with these.

Once ruby is alive - you can try upgrading rubygems again by sudo gem update --system if needed, but I advise setting up a ruby version manager like rvm (rvm.io) and leave the system ruby be there only for emergences and backing the brew.



Related Topics



Leave a reply



Submit