Last active
March 23, 2025 02:05
-
-
Save aseroff/2b74bcaef64bd5b20f06b226ba0cf725 to your computer and use it in GitHub Desktop.
The stupid hoops required to install mysql2 gem with brew-installed mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql_version=$(brew list --versions mysql | tr ' ' '\n' | tail -1) | |
mysql_path=$(brew --cellar mysql)/$mysql_version | |
gem install mysql2 -- \ | |
--with-mysql-lib=$mysql_path/lib \ | |
--with-mysql-dir=$mysql_path \ | |
--with-mysql-config=$mysql_path/bin/mysql_config \ | |
--with-mysql-include=$mysql_path/include \ | |
--with-openssl-dir=/usr/local/Cellar/openssl@3/3.1.2 | |
# or add to ./bundle/config | |
BUNDLE_BUILD__MYSQL2: "--with-mysql-lib=/usr/local/Cellar/mysql/8.2.0_1/lib" | |
BUNDLE_BUILD__MYSQL2: "--with-mysql-dir=/usr/local/Cellar/mysql/8.2.0_1/" | |
BUNDLE_BUILD__MYSQL2: "--with-mysql-config=/usr/local/Cellar/mysql/8.2.0_1/bin/mysql_config" | |
BUNDLE_BUILD__MYSQL2: "--with-mysql-include=/usr/local/Cellar/mysql/8.2.0_1/lib/include" | |
BUNDLE_BUILD__MYSQL2: "--with-openssl-dir=/usr/local/Cellar/openssl@3/3.2.0_1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from brianmario/mysql2#1175 (comment)