Skip to content

Instantly share code, notes, and snippets.

@mchlggr
Forked from fernandoaleman/mysql2-m1.md
Created December 5, 2023 21:06
Show Gist options
  • Save mchlggr/debf36194811eb4ad97af0b5f33c11c5 to your computer and use it in GitHub Desktop.
Save mchlggr/debf36194811eb4ad97af0b5f33c11c5 to your computer and use it in GitHub Desktop.
How to install mysql2 gem on m1 Mac

Problem

Installing mysql2 gem errors on m1 Mac.

Solution

Make sure mysql, openssl and zstd are installed on Mac via Homebrew.

brew install mysql openssl zstd

Install mysql2 gem.

gem install mysql2 -v '0.5.3' -- --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-ldflags="-L$(brew --prefix zstd)/lib -L$(brew --prefix openssl)/lib" --with-cppflags=-I$(brew --prefix openssl)/include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment