エラーメッセージ
extconf.rb:40:in popen': Permission denied - /usr/local/Cellar/libpq/15.1 (Errno::EACCES) from extconf.rb:40:in
'
1.rbenvを再インストール
% rbenv uninstall 3.0.2
% RUBY_CFLAGS="-Wno-error=implicit-function-declaration" arch -x86_64 rbenv install 3.0.2
2.gemを削除,Gemfile.lockを削除
% sudo rm -rf vendor/bundle
Gemfile.lockを削除
3.bundleインストール
% bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql@14/14.6/bin/pg_config
=>config=の後はpg_configのフルパスを書く
% bundle config build.pg --with-pg-config=/opt/homebrew/Cellar/libpq/14.5/bin/pg_config
% bundle install