Skip to content

Instantly share code, notes, and snippets.

@jbwl
Forked from fernandoaleman/mysql2-catalina.md
Created February 12, 2021 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbwl/cdf02a3260babb6335019e89397a84cc to your computer and use it in GitHub Desktop.
Save jbwl/cdf02a3260babb6335019e89397a84cc to your computer and use it in GitHub Desktop.
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl

Install mysql2 gem.

gem install mysql2 -v '0.5.3' -- --with-mysql-config=/usr/local/Cellar/mysql@5.7/5.7.29/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
@jbwl
Copy link
Author

jbwl commented Jul 13, 2021

0.3.21 on Big Sur

brew link mariadb

gem install mysql2 -v '0.3.21' -- --with-mysql-config=/usr/local/Cellar/mariadb/10.6.3/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment