I think you need to gem install mysql2
inside the container.
Make sure that you read this:
https://meta.discourse.org/t/advanced-troubleshooting-with-docker/15927
You’ll install stuff needed for the migration, then when it’s all done you rebuild the container and it’ll go away.