Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ruby

rvm

I have need of Ruby 2.0.0, so I turned to RVM to help manage my ruby installations.

However, when I do rvm install ruby-2.0.0, the installation ends up bombing out.

$ rvm install ruby-2.0.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.0.0-p648.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/nick/.rvm/rubies/ruby-2.0.0-p648, this may take a while depending on your cpu(s)...
ruby-2.0.0-p648 - #downloading ruby-2.0.0-p648, this may take a while depending on your connection...
ruby-2.0.0-p648 - #extracting ruby-2.0.0-p648 to /Users/nick/.rvm/src/ruby-2.0.0-p648....
ruby-2.0.0-p648 - #applying patch /Users/nick/.rvm/patches/ruby/2.0.0/openssl3.patch.
ruby-2.0.0-p648 - #applying patch /Users/nick/.rvm/patches/ruby/2.0.0/update-autoconf.patch.
ruby-2.0.0-p648 - #configuring.................................................
ruby-2.0.0-p648 - #post-configuration.
ruby-2.0.0-p648 - #compiling...................................................|
ruby-2.0.0-p648 - #installing..............
ruby-2.0.0-p648 - #making binaries executable..
ruby-2.0.0-p648 - #downloading rubygems-2.7.2
ruby-2.0.0-p648 - #extracting rubygems-2.7.2.....
ruby-2.0.0-p648 - #removing old rubygems........
ruby-2.0.0-p648 - #installing rubygems-2.7.2.
Error running 'env GEM_HOME=/Users/nick/.rvm/gems/ruby-2.0.0-p648@global GEM_PATH= /Users/nick/.rvm/rubies/ruby-2.0.0-p648/bin/ruby -d /Users/nick/.rvm/src/rubygems-2.7.2/setup.rb --no-document',
please read /Users/nick/.rvm/log/1510703598_ruby-2.0.0-p648/rubygems.install.log

So, I check out the log file as instructed, and this is what I see:

[2017-11-14 15:55:25] /Users/nick/.rvm/rubies/ruby-2.0.0-p648/bin/ruby
current path: /Users/nick/.rvm/src/rubygems-2.7.2
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/nick/.nvm/versions/node/v8.4.0/bin:/usr/local/sbin:/usr/local/bin:/Users/nick/.gvm/vertx/current/bin:/Users/nick/.gvm/springboot/current/bin:/Users/nick/.gvm/lazybones/current/bin:/Users/nick/.gvm/jbake/current/bin:/Users/nick/.gvm/groovyserv/current/bin:/Users/nick/.gvm/groovy/current/bin:/Users/nick/.gvm/griffon/current/bin:/Users/nick/.gvm/grails/current/bin:/Users/nick/.gvm/gradle/current/bin:/Users/nick/.gvm/glide/current/bin:/Users/nick/.gvm/gaiden/current/bin:/Users/nick/.gvm/crash/current/bin:/usr/local/mongodb_2.4.5/bin:/Users/nick/.gvm/grails/current/bin:/usr/local/mysql/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin:/usr/local/mongodb_2.4.5/bin:/Users/nick/.gvm/grails/current/bin:/usr/local/scala-2.12.1/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/share/dotnet:/usr/local/git/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/nick/.rvm/bin
command(7): env GEM_HOME=/Users/nick/.rvm/gems/ruby-2.0.0-p648@global GEM_PATH= /Users/nick/.rvm/rubies/ruby-2.0.0-p648/bin/ruby -d /Users/nick/.rvm/src/rubygems-2.7.2/setup.rb --no-document
Exception `LoadError' at /Users/nick/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/rubygems.rb:1087 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/nick/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/rubygems.rb:1096 - cannot load such file -- rubygems/defaults/ruby
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
Bundler 1.16.0 installed
RubyGems 2.7.2 installed
Regenerating binstubs

I'm not really sure what to make of this error. I've tried uninstalling 2.0.0 and installing it again, imploding & reinstalling rvm, even reinstalling ruby with homebrew and doing everything from scratch, but this error persists. Any ideas?

like image 416
nasukkin Avatar asked Nov 14 '17 23:11

nasukkin


2 Answers

Try installing Ruby using the --rubygems ignore option:

$ rvm install ruby-2.0.0 --rubygems ignore

like image 124
garythegoat Avatar answered Oct 20 '22 06:10

garythegoat


Mention a specific version of rubygems will work too

rvm reinstall ruby-head --rubygems 2.6.11
like image 7
DilumN Avatar answered Oct 20 '22 06:10

DilumN