Failure to install old mysql2 gem

As per the description shared it seems like the mysql dependencies are unable to install.

First we need to ‘locate mysql_config’ and then replace the path in the following command with where that file is.

gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

This fixed it for me

gem install mysql2 -v '0.3.21' -- --with-cflags=\"-I/usr/local/opt/openssl/include\" --with-ldflags=\"-L/usr/local/opt/openssl/lib\"

after installing openssl

brew install openssl