2026-05-20 bundle install 時に libyaml error
issue
bundle install 時に libyaml 関連のエラーが発生したときの対処法。
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
--- ERROR REPORT TEMPLATE -------------------------------------------------------
LoadError: dlopen(/.../lib/psych.bundle, 0x0009): Library not loaded: /opt/homebrew/opt/libyaml/lib/libyaml-0.2.dylib
Referenced from: <55627C2C-6AA4-30DB-A843-7C9777FEBF7F>
Reason: tried: '/opt/homebrew/opt/libyaml/lib/libyaml-0.2.dylib' (no such file)
...
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
solution
原因は libyaml がないことが原因。brew で libyaml をインストールすることで解決する。
$ brew install libyaml