Skip to content

Instantly share code, notes, and snippets.

@nickcoyne
Created November 12, 2023 17:30
Show Gist options
  • Save nickcoyne/1c72447bec4a924c761b67fac6cca7a6 to your computer and use it in GitHub Desktop.
Save nickcoyne/1c72447bec4a924c761b67fac6cca7a6 to your computer and use it in GitHub Desktop.
Apple silicon mysql2 install

If struggling with a working MySQL install on an Apple Silicon Mac...

See https://dev.to/truemark/solved-error-while-installing-mysql2-gem-in-m1-mac-1mab

Update mysql and zstd version numbers and paths as appropriate for you system:

rbenv exec gem install mysql2 -- \
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.1.0/lib \
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.1.0 \
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.1.0/bin/mysql_config \
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.1.0/include

bundle config --local build.mysql2 \
    "--with-ldflags=-L/opt/homebrew/Cellar/zstd/1.5.5/lib"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment