Skip to content

Ruby installation is missing Psych. Ruby yaml extension not compiled #1251

Closed

Description

@DirtyF

My setup:

  • macOS Mojave with ruby 2.3.7 as the default ruby (/usr/bin/ruby)
  • brew install ruby install ruby 2.5.3 (/usr/local/opt/ruby/bin/ruby)
  • gems are installed in ~/gems/
gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.8
  - RUBY VERSION: 2.5.3 (2018-10-18 patchlevel 105) [x86_64-darwin18]
  - INSTALLATION DIRECTORY: /Users/frank/gems
  - USER INSTALLATION DIRECTORY: /Users/frank/.gem/ruby/2.5.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/frank/gems/bin
  - SPEC CACHE DIRECTORY: /Users/frank/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.5.3_1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-18
  - GEM PATHS:
     - /Users/frank/gems
     - /Users/frank/.gem/ruby/2.5.0
     - /usr/local/lib/ruby/gems/2.5.0
     - /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/gems/2.5.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/opt/llvm@4/bin
     - /Users/frank/.rbenv/shims
     - /Users/frank/.rbenv/bin
     - /Users/frank/gems/bin
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - ~/bin
     - /Users/frank/.go/bin
     - /usr/local/opt/go/libexec/bin
     - /usr/local/opt/fzf/bin

When I run rbenv install 2.6.0-preview3 the following error occurs on macOS Mojave:

/Users/frank/.rbenv/versions/2.6.0-preview3/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions

The Psych gem is installed for ruby 2.5.3:

otool -L ~/gems/gems/psych-3.0.3/lib/psych.bundle
/Users/frank/gems/gems/psych-3.0.3/lib/psych.bundle:
	/usr/local/opt/ruby/lib/libruby.2.5.dylib (compatibility version 2.5.0, current version 2.5.3)
	/usr/local/opt/libyaml/lib/libyaml-0.2.dylib (compatibility version 3.0.0, current version 3.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

What is wrong? How do I fix this?

Activity

  1. changed the title [-]Ruby installation is miissing Psych, Ruby yaml extension not compiled[/-] [+]Ruby installation is missing Psych. Ruby yaml extension not compiled[/+] on Nov 8, 2018
  2. hsbt commented on Nov 8, 2018

    @hsbt
    Member

    Your pysch extension(~/gems/gems/psych-3.0.3/lib/psych.bundle) was built by 2.5.x.

  3. DirtyF commented on Nov 8, 2018

    @DirtyF
    ContributorAuthor

    @hsbt thanks, by uninstalling psych, rbenv installed ruby 2.6.0-preview3 without errors:

    Installed ruby-2.6.0-preview3 to /Users/frank/.rbenv/versions/2.6.0-preview3

  4. taliesinpenbardd commented on Dec 12, 2018

    @taliesinpenbardd

    Same problem here. gem command won't respond to anything :

    To eliminate this warning, please install libyaml and reinstall your ruby.
    Traceback (most recent call last):
    	15: from /usr/local/bin/gem:21:in `<main>'
    	14: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/gem_runner.rb:44:in `run'
    	13: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/gem_runner.rb:79:in `do_configuration'
    	12: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/gem_runner.rb:79:in `new'
    	11: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/config_file.rb:202:in `initialize'
    	10: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/config_file.rb:349:in `load_file'
    	 9: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems.rb:729:in `load_yaml'
    	 8: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    	 7: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    	 6: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/yaml.rb:6:in `<top (required)>'
    	 5: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    	 4: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    	 3: from /Users/lucdlb/.rvm/gems/ruby-2.5.1/gems/psych-3.0.3/lib/psych.rb:13:in `<top (required)>'
    	 2: from /Users/lucdlb/.rvm/gems/ruby-2.5.1/gems/psych-3.0.3/lib/psych.rb:16:in `rescue in <top (required)>'
    	 1: from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': incompatible library version - /Users/username/.rvm/gems/ruby-2.5.1/gems/psych-3.0.3/lib/psych.bundle (LoadError)
    

    ruby -v:
    ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]

    OS :
    Mac OS X Mojave 10.14.1

    Any idea how to debug that ?

  5. DirtyF commented on Dec 12, 2018

    @DirtyF
    ContributorAuthor

    @taliesinpenbardd so you can not run gem unsinstall psych? Maybe try to remove /Users/username/.rvm/gems/ruby-2.5.1/gems/psych-3.0.3/ manually?

  6. taliesinpenbardd commented on Dec 12, 2018

    @taliesinpenbardd

    @DirtyF I've finally uninstalled RVM, and tried my luck with RBENV. No luck so far, I still can't use the gems I've installed (and reinstalled). I suppose it's a wrong installation location on the system, or perhaps a permissions problem. Still looking, but I guess it's out of the focus of this ticket.
    Thanks anyway.

  7. DirtyF commented on Dec 12, 2018

    @DirtyF
    ContributorAuthor

    @taliesinpenbardd FWIW you can choose to store your gems in your home directory, by adding the following to your shell config file:

    export GEM_HOME=$HOME/gems
    export PATH=$HOME/gems/bin:$PATH
    
  8. taliesinpenbardd commented on Dec 13, 2018

    @taliesinpenbardd

    @DirtyF Thank you very much, it seems to work. (and thank you also, I did discover Jekyll and am gonna use it sometime in the future. 😄 )

  9. farisarie commented on Apr 27, 2022

    @farisarie

    i have a problem when i trying to installing feedkit library and this warning showup I didn't find any solution, do u know what I should do?

    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
    To eliminate this warning, please install libyaml and reinstall your ruby.
    /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/psych-4.0.2/lib/psych.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/psych-4.0.2/lib/psych.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/psych.bundle' (no such file) - /Library/Ruby/Gems/2.6.0/gems/psych-4.0.2/lib/psych.bundle (LoadError)

  10. eertmanhidde commented on May 5, 2022

    @eertmanhidde

    Running gem uninstall psych from my older ruby version(2.7.2) fixed the issue for me

  11. askdesigners commented on Jul 15, 2022

    @askdesigners

    I get this when trying to uninstall
    Gem psych-4.0.3 cannot be uninstalled because it is a default gem

  12. locked and limited conversation to collaborators on Jul 15, 2022
  13. converted this issue into a discussion #2012 on Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions