Skip to content

Instantly share code, notes, and snippets.

@DevGW
Last active June 27, 2023 19:54
Show Gist options
  • Save DevGW/855fb4a9620f7f9eaf237fb2961cc87b to your computer and use it in GitHub Desktop.
Save DevGW/855fb4a9620f7f9eaf237fb2961cc87b to your computer and use it in GitHub Desktop.
Ruby / Rails :: install mySQL2 gem #rails
gem install mysql2 -- --with-mysql-config=/usr/local/Cellar/mysql\@5.7/5.7.24/bin/mysql_config
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
// then to start the site, be in the ruby directory (this command will make it's own directory for the site)
rails new sitename -d mysql
MAC M1 ---
gem install mysql2 -v '0.4.7' -- \
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.26/lib \
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.26 \
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.26/bin/mysql_config \
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.26/include
gem install mysql2 -v '0.5.3' -- \
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.28_1/lib \
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.28_1 \
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.28_1/bin/mysql_config \
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.28_1/include
gem install mysql2 -v '0.4.10' -- \
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.33/lib \
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.33 \
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.33/bin/mysql_config \
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.33/include
gem install mysql2 -v '0.4.10' -- \
--with-cflags=\"-I/opt/homebrew/opt/openssl/include\" \
--with-ldflags=\"-L/opt/homebrew/opt/openssl/lib\" \
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.33/lib \
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.33 \
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.33/bin/mysql_config \
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.33/include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment