This is a maintenance note for older Rails projects. MySQL 5.7 reached end of life in October 2023, so installing it today should be a temporary compatibility measure, not an architectural vision.
Skip Homebrew auto-update for one command
1 | HOMEBREW_NO_AUTO_UPDATE=1 brew install <formula> |
This saves time in a controlled environment, but skipping updates permanently also skips security and formula fixes. Use it intentionally, not as a lifestyle.
Why bundle exec matters
1 | bundle exec rspec |
Bundler activates the gem versions recorded in Gemfile.lock. Running rspec directly may execute another globally installed version.
Binstubs provide a shorter project-scoped command:
1 | bundle binstubs rspec-core |
Running a legacy MySQL version
Prefer a container or isolated environment so an obsolete database does not replace the supported system version:
1 | services: |
Never use that development password in production.
If Homebrew is unavoidable, use the versioned formula while it remains available:
1 | brew install mysql@5.7 |
Rebuild native gems against the selected client libraries:
1 | bundle config set --local build.mysql2 \ |
Do not begin with rm -rf /usr/local/var/mysql. That directory may contain every local database you forgot to back up, and deletion is a very efficient migration strategy in the wrong direction.
Migration checks
Rails can raise when pending migrations exist:
1 | config.active_record.migration_error = :page_load |
Disabling the check with false hides the warning; it does not make the schema current. Use that only when another deployment process guarantees migrations.