Edit 2021-02-21: I've confirmed this solution works with both heroku-18 and heroku-20 stacks.
What follows is my solution for having mysql2
gem compiled and working against MySQL v5.7 (rather than v8+) on the heroku-20
stack. This is how I've managed to make it work:
- Add the apt buildstack ahead of your standard buildpack (in my case, that's Ruby):
$ heroku buildpacks:add --index 1 heroku-community/apt