rubyrvmpsych

Install ruby 3.3.x with rvm, missing psych gym


I'm installing ruby 3.3.x with rvm by rvm install 3.3.5, no apparent error shown. However, I noticed psych gem folder is empty,even though it's there in the gem list as psych 5.1.2. this causing problems when I try to gem install/uninstall anything, since it keeps saying, cannot load file --psych. Any ideas how to fix this issue please. Thanks in advance.

env setting:

<20240904 10:03:07>$ rvm use 3.3.5
Using /home/idm/.rvm/gems/ruby-3.3.5
<20240904 10:03:22>$ which ruby
~/.rvm/rubies/ruby-3.3.5/bin/ruby
<20240904 10:03:35>$ ruby -v
ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
<20240904 10:03:38>$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.5.16
  - RUBY VERSION: 3.3.5 (2024-09-03 patchlevel 100) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/idm/.rvm/gems/ruby-3.3.5
  - USER INSTALLATION DIRECTORY: /home/idm/.gem/ruby/3.3.0
  - RUBY EXECUTABLE: /home/idm/.rvm/rubies/ruby-3.3.5/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/idm/.rvm/gems/ruby-3.3.5/bin
  - SPEC CACHE DIRECTORY: /home/idm/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/idm/.rvm/rubies/ruby-3.3.5/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /home/idm/.rvm/gems/ruby-3.3.5
     - /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/idm/.rvm/gems/ruby-3.3.5/bin
     - /home/idm/.rvm/gems/ruby-3.3.5@global/bin
     - /home/idm/.rvm/rubies/ruby-3.3.5/bin
     - /home/idm/.rvm/bin
     - /usr/local/bin
     - /usr/bin
     - /usr/local/sbin
     - /usr/sbin
     - /home/idm/.local/bin
     - /home/idm/bin
<20240904 10:03:52>$

error:

<20240904 10:05:53>$ gem install bundler
<internal:/home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- psych (LoadError)
        from <internal:/home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems.rb:594:in `load_yaml'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/specification.rb:1240:in `_load'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/safe_marshal/visitors/to_ruby.rb:351:in `call_method'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/safe_marshal/visitors/to_ruby.rb:182:in `visit_Gem_SafeMarshal_Elements_UserDefined'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/safe_marshal/visitors/visitor.rb:6:in `visit'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/safe_marshal/visitors/to_ruby.rb:28:in `visit'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/safe_marshal.rb:71:in `load'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/safe_marshal.rb:61:in `safe_load'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/source.rb:139:in `fetch_spec'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/resolver/api_specification.rb:93:in `spec'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/resolver/installer_set.rb:99:in `add_always_install'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/dependency_installer.rb:318:in `resolve_dependencies'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/commands/install_command.rb:198:in `install_gem'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/commands/install_command.rb:223:in `block in install_gems'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/commands/install_command.rb:216:in `each'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/commands/install_command.rb:216:in `install_gems'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/commands/install_command.rb:162:in `execute'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/command.rb:326:in `invoke_with_build_args'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/command_manager.rb:255:in `invoke_command'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/command_manager.rb:194:in `process_args'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/command_manager.rb:152:in `run'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/gem_runner.rb:56:in `run'
        from /home/idm/.rvm/rubies/ruby-3.3.5/bin/gem:12:in `<main>'

<20240904 10:06:05>$ irb
3.3.5 :001 > require 'psych'
<internal:/home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- psych (LoadError)
        from <internal:/home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
        from (irb):1:in `<main>'
        from <internal:kernel>:187:in `loop'
        from /home/idm/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/irb-1.13.1/exe/irb:9:in `<top (required)>'
        from /home/idm/.rvm/rubies/ruby-3.3.5/bin/irb:25:in `load'
        from /home/idm/.rvm/rubies/ruby-3.3.5/bin/irb:25:in `<main>'
3.3.5 :002 >


Solution

  • The issue was due to libyaml-devel was missing, causing rvm install 3.3.x unable to install psych gem.