我正在尝试通过Mac OS Catalina上的rbenv安装ruby-2.2.3,但收到以下错误

时间:2020-10-01 07:47:36

标签: ruby macos homebrew macos-catalina rbenv

installing bundle gems:
/Users/oyo/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
/private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/.ext/common/psych.rb:370:in `parse': (<unknown>): mapping values are not allowed in this context at line 1 column 9 (Psych::SyntaxError)
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/.ext/common/psych.rb:370:in `parse_stream'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/.ext/common/psych.rb:318:in `parse'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/.ext/common/psych.rb:245:in `load'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/config_file.rb:333:in `load_file'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/config_file.rb:198:in `initialize'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems.rb:297:in `new'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems.rb:297:in `configuration'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/remote_fetcher.rb:51:in `fetcher'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/spec_fetcher.rb:76:in `initialize'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/spec_fetcher.rb:42:in `new'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/spec_fetcher.rb:42:in `fetcher'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/resolver/installer_set.rb:37:in `initialize'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/dependency_installer.rb:430:in `new'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/dependency_installer.rb:430:in `resolve_dependencies'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems/dependency_installer.rb:373:in `install'
    from /private/var/folders/sk/qhgy79hd7pg63m0_kq67wyb40000gq/T/ruby-build.20200929175743.1274.5WLeHn/ruby-2.2.3/lib/rubygems.rb:558:in `install'
    from ./tool/rbinstall.rb:722:in `block (2 levels) in <main>'
    from ./tool/rbinstall.rb:721:in `each'
    from ./tool/rbinstall.rb:721:in `block in <main>'
    from ./tool/rbinstall.rb:757:in `call'
    from ./tool/rbinstall.rb:757:in `block in <main>'
    from ./tool/rbinstall.rb:754:in `each'
    from ./tool/rbinstall.rb:754:in `<main>'
make: *** [do-install-all] Error 1

1 个答案:

答案 0 :(得分:0)

Rubygems可以使用from sklearn.preprocessing import StandardScaler import numpy as np import matplotlib.pyplot as mlt import seaborn as sb precipitation = { 'rain': 0, 'snow': 1} train['precip_type'][train['precip_type'] == 'rain'] =0 train['precip_type'][train['precip_type'] == 'snow'] =1 stdsclr = StandardScaler() transf = stdsclr.fit_transform(train.values) cov_mat = np.cov(transf.T) mlt.figure(figsize=(12,12)) hm = sb.heatmap(cov_mat, annot=True, annot_kws={'size': 10}, cmap='coolwarm', yticklabels=train.columns , xticklabels=train.columns) mlt.show() """ there is insignificancy in wind_speed, cloud_cover, pressure and wind_bearing since they are not correlated """ 文件进行配置。在这里,您可以设置各种选项,这些选项会影响Rubygems默认情况下如何获取和安装gem。该gemrc文件应为YAML格式。

在您的情况下,您当前的gemrc文件似乎不是有效的YAML,因此无法正确解析。要解决此问题,您应该检查以下位置的文件并将其修复为有效的YAML:

  • 系统范围-gemrc
  • 每位用户-/etc/gemrc
  • 每个环境-~/.gemrc环境变量中列出的gemrc文件