Skip to content

Instantly share code, notes, and snippets.

@tonyclemmey
Forked from fernandoaleman/mysql2-catalina.md
Created June 11, 2020 17:49
Show Gist options
  • Save tonyclemmey/588ed1eccfe29e9945807b8da6801fc2 to your computer and use it in GitHub Desktop.
Save tonyclemmey/588ed1eccfe29e9945807b8da6801fc2 to your computer and use it in GitHub Desktop.
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl

Install mariadb connector which includes all libraries required for most packages.

brew tap frnhr/homebrew-mariadb-connector-c-2
brew install frnhr/mariadb-connector-c-2/mariadb-connector-c

Install mysql2 gem.

env ARCHFLAGS="-arch x86_64" gem install mysql2 -v '0.5.2' -- --with-mysql-config=/usr/local/Cellar/mariadb-connector-c/2.2.2/bin/mariadb_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