Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DirtyF opened this issue Nov 8, 2018 · 10 comments
Closed

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

DirtyF opened this issue Nov 8, 2018 · 10 comments

Comments

@DirtyF
Copy link
Contributor

DirtyF commented Nov 8, 2018

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?

@DirtyF DirtyF changed the title Ruby installation is miissing Psych, Ruby yaml extension not compiled Ruby installation is missing Psych. Ruby yaml extension not compiled Nov 8, 2018
@hsbt
Copy link
Member

hsbt commented Nov 8, 2018

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

@DirtyF
Copy link
Contributor Author

DirtyF commented Nov 8, 2018

@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

@DirtyF DirtyF closed this as completed Nov 8, 2018
@taliesinpenbardd
Copy link

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 ?

@DirtyF
Copy link
Contributor Author

DirtyF commented Dec 12, 2018

@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?

@taliesinpenbardd
Copy link

@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.

@DirtyF
Copy link
Contributor Author

DirtyF commented Dec 12, 2018

@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

@taliesinpenbardd
Copy link

@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. 😄 )

@farisarie
Copy link

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)

@eertmanhidde
Copy link

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

@askdesigners
Copy link

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

@rbenv rbenv locked and limited conversation to collaborators Jul 15, 2022
@hsbt hsbt converted this issue into discussion #2012 Jul 15, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants