GitHub Codespaces and VSCode remote development solve this problem by using docker and optionally docker compose to create reproducible development environments.
GitHub is using Codespaces itself [0], which is a huge Rails app with tons of infrastructure behind it I’d assume.
[0]: https://github.blog/2021-08-11-githubs-engineering-team-move...