Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@NBlixt

This comment has been minimized.

Copy link

NBlixt commented Jul 1, 2020

I'm getting a 404 error with the second command (brew install frnhr/mariadb-connector-c-2/mariadb-connector-c).

% brew install frnhr/mariadb-connector-c-2/mariadb-connector-c
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
exploitdb

==> Installing mariadb-connector-c from frnhr/mariadb-connector-c-2
==> Downloading https://homebrew.bintray.com/bottles-mariadb-connector-c-2/mariadb-connector-c-2.2.2.high_sierra.bottle.tar.gz
#=#=#                                                                         
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "mariadb-connector-c"
Download failed: https://homebrew.bintray.com/bottles-mariadb-connector-c-2/mariadb-connector-c-2.2.2.high_sierra.bottle.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.