macでローカル環境を作るときに出やすいエラー
An error occurred while installing mysql2 (0.5.2), and Bundler cannot
continue.
Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'`
succeeds before bundling.
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen
対応
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
$ sudo chown -R (ユーザ名):staff /Users/(ユーザ名)/.rbenv
$ bin/bundle config --local build.mysql2 "--with-cppflags=-I/usr/local/opt/openssl/include"
$ bin/bundle install --path vendor/bundle