Cool, but why not just use Docker? 2-4GB extra ram overhead and some initial learning curve, add a decent Makefile and.. never worry about local env ever again. Switch back and forth between Mac, Windows, Linux like it's nothing.
Add to this that Rails 7.1 comes with a pre-generated Dockerfile that works quite well out of the box