I needed to set the PATH for zstd to install mysql2 gem.
export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ gem install mysql2
https://zenn.dev/yukionodera/articles/how-to-fix-error-mysql2