evilmartians / ruby-on-whales

Ruby on Whales example and templates
MIT License
295 stars 26 forks source link

How to fix "It seems your ruby installation is missing psych (for YAML output)."? #15

Closed wuarmin closed 2 years ago

wuarmin commented 2 years ago

Hey, thank you for this repo. I learned a lot from it. I updated the ruby version of one of my projects from 2.7.x to 3.0.0, but now I'm struggling with the following bundle install-error:

/usr/local/lib/ruby/3.0.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.
LoadError: libruby.so.3.1: cannot open shared object file: No such file or directory - /usr/local/bundle/gems/psych-3.3.2/lib/psych.so

I'm using ruby:3.0.3-slim-buster. Installing libyaml-dev does not solve the issue.

Do you know the reason for this?

Thanks and best regards

palkan commented 2 years ago

Looks similar to this issue: https://github.com/rbenv/ruby-build/issues/1251

You probably have extensions built for Ruby 2.7, which are not compatible with Ruby 3.0. Just drop the bundle volume (or create a new one for Ruby 3.0).

wuarmin commented 2 years ago

Thanks I fixed it with your suggestion.

farisarie commented 2 years ago

rbenv/ruby-build#1251 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)

Hadi111jafari commented 2 years ago

Hi @palkan and @wuarmin I am having same issue how can I drop the bundle volume or create for a new one for ruby 3.1.2

palkan commented 2 years ago

When doing Ruby upgrades, I prefer to create a new volume (say, bundle31), so I can still switch between versions (e.g., when switching WIP branches) and do not lose the bundle state; also, with a new volume, no need to run any commands beside bundle install for everyone on the team.

neil1023 commented 1 year ago

How did you folks create this new bundle volume?