Rubygems安装或降级/删除rubygems

时间:2018-02-28 23:48:11

标签: ruby rubygems rhel7

我在RHEL7机器上安装了ruby 1.8.7,使用了rubygems 2.7.6。我知道1.8.7已经过时了,但我需要它来运行我们的特定软件包。当我尝试安装任何gem时,它会遇到Gem :: Package :: PathError。

$ gem install rb-readline
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  While executing gem ... (Gem::Package::PathError)
installing into parent path CHANGES of /eog/reference/lib/ruby/gems/1.8/gems/rb-readline-0.5.5 is not allowed

这是我的gem env输出

    YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.6
  - RUBY VERSION: 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
  - INSTALLATION DIRECTORY: /eog/reference/lib/ruby/gems/1.8
  - USER INSTALLATION DIRECTORY: /home/nrt/.gem/ruby/1.8
  - RUBY EXECUTABLE: /eog/reference/bin/ruby
  - EXECUTABLE DIRECTORY: /eog/reference/bin
  - SPEC CACHE DIRECTORY: /home/nrt/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /eog/reference/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /eog/reference/lib/ruby/gems/1.8
     - /home/nrt/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/lib/qt-3.3/bin
     - /eog/reference/bin
     - /eog/reference/scripts
     - /eog/reference/matlab
     - /eog/reference/java
     -
     - /usr/local/bin
     - /usr/bin
     - /usr/local/sbin
     - /usr/sbin
     - /opt/ngdc/groovy/bin
     - /opt/ngdc/p7zip/bin
     - /home/nrt/.local/bin
     - /home/nrt/bin

我怀疑安装心理可能会解决问题,但它需要ruby> = 2.2.2。

YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  Error installing psych:
        There are no versions of psych (>= 0) compatible with your Ruby & RubyGems
        psych requires Ruby version >= 2.2.2. The current ruby version is 1.8.

由于我无法将ruby升级到超过1.8.7,这将导致软件崩溃。我试着按照命令降级rubygems但没有成功。

gem update --system 1.3.7

我可以解决gem安装问题的任何想法,或者如果没有,请将我的rubygems降级到旧版本?

0 个答案:

没有答案