“无法加载此类文件 -- ruby​​gems/defaults/operating_system"安装 Ruby 2.0.0 时 [英] "cannot load such file -- rubygems/defaults/operating_system" when installing Ruby 2.0.0

查看:86
本文介绍了“无法加载此类文件 -- ruby​​gems/defaults/operating_system"安装 Ruby 2.0.0 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要 Ruby 2.0.0,所以我求助于 RVM 来帮助管理我的 ruby​​ 安装.

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

然而,当我执行 rvm install ruby​​-2.0.0 时,安装结束了.

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

我不确定如何处理这个错误.我试过卸载 2.0.0 并再次安装它,内爆 &重新安装 rvm,甚至用自制软件重新安装 ruby​​ 并从头开始做所有事情,但此错误仍然存​​在.有什么想法吗?

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?

推荐答案

尝试使用 --rubygems ignore 选项安装 Ruby:

Try installing Ruby using the --rubygems ignore option:

$ rvm install ruby​​-2.0.0 --rubygems 忽略

这篇关于“无法加载此类文件 -- ruby​​gems/defaults/operating_system"安装 Ruby 2.0.0 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆