If you want to install the gem (client) without having a database, doing brew install mysql-connector-c
used to work, but not anymore.
You now have to install a compatible connector (mariadb):
brew install mariadb-connector-c
bundle config build.mysql2 "--with-mysql-config=$(brew info mariadb-connector-c | grep /usr/local | cut -d ' ' -f 1)/bin/mariadb_config"
bundle install
You may also have to install missing headers (see brianmario/mysql2#1045):
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
Related ressources:
You can avoid the
grep
andcut
by usingbrew --prefix
: