pavlog

ウェブエンジニアがあれやこれやを書きます

Is Ruby dead? No, it isn't dead.

ruby-image

but it is broken or in the future it will be broken.

というわけで、記事を書いてます。

本日もRubyが壊れたので直していきましょう。

エラーメッセージ

/Users/ikezawa-ryota/.anyenv/envs/rbenv/versions/2.3.7/lib/ruby/2.3.0/yaml.rb:5:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
LoadError: incompatible library version - /Users/ikezawa-ryota/src/github.com/org/repo/vendor/bundle/ruby/2.3.0/gems/psych-3.1.0/lib/psych.bundle
/Users/ikezawa-ryota/.anyenv/envs/rbenv/versions/2.3.7/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:54:in `require': incompatible library version - /Users/ikezawa-ryota/src/github.com/org/repo/vendor/bundle/ruby/2.3.0/gems/psych-3.1.0/lib/psych.bundle (LoadError)
        from /Users/ikezawa-ryota/.anyenv/envs/rbenv/versions/2.3.7/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /Users/ikezawa-ryota/src/github.com/org/repo/vendor/bundle/ruby/2.3.0/gems/psych-3.1.0/lib/psych.rb:16:in `rescue in <top (required)>'
        from /Users/ikezawa-ryota/src/github.com/org/repo/vendor/bundle/ruby/2.3.0/gems/psych-3.1.0/lib/psych.rb:13:in `<top (required)>'

bundle install が通らなくなってしまった。原因不明、突然の病です。

復旧手順

備忘録的に手順を記載しておきます。

rm /Users/ikezawa-ryota/src/github.com/org/repo/vendor/bundle/ruby/2.3.0/gems/psych-3.1.0/lib/psych.bundle
bundle install

結論

形あるものはいずれ壊れる

Rubyは死んでない