Troubleshoot: errors installing mysql2 gem
17 March 2022 (Updated 17 March 2022)
This finally worked for me on macOS Monterey 12.3 (M1 Pro):
gem install mysql2 -- --with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.28_1
Make sure you read the installation instructions. Notable points for me were:
- Make sure MySQL is installed (
brew install mysql
) - Make sure XCode select tools are installed (
xcode-select --install
) - Set the
with-mysql-dir
option to wherever mysql was installed (check withbrew info mysql
)
Tagged:
Ruby tooling
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment