Created
December 7, 2023 17:06
-
-
Save davidlowry/53812a983392b7d8dc8453ba317ac80d to your computer and use it in GitHub Desktop.
Installing MySQL gem for Rails bundler on Mac Silicon
This file contains 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
# Install rails, mysql, etc by homebrew using this guide https://gorails.com/setup/macos/10.14-mojave - but if you require mysql and can't upgrade to Trilogy, this is required (and not in the guide at time of writing) | |
# With credit to Chris Oliver @excid3 at Go Rails | |
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 |
- Ruby 3.2.2 + Rails 6.1.7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confirmed working Ruby 2.7.8, Rails 5.2?