There are a bunch of competing tools related to this use case, but the starting point for many (most?) of them is direnv’s Nix integration.
Direnv is nice because it’s also popular outside of the Nix world, so most editors/IDEs have plugins that offer some measure of integration with it.
I’d start by playing with that, and then see if anyone here argues for their other tools of choice in a way that resonates with you. If you try to review the whole landscape of Nix tooling for that use case before you start experimenting, you might find yourself overwhelmed or bored.
devenv.sh also has direnv integration, which will automatically load the devenv into your shell when you cd into your project directory. See Automatic Shell Activation - devenv
If you’re used to rbenv or rvm, it’ll work very similarly. The devenv config also has an option to specify a .ruby-version so your project can stay compatible with rbenv and rvm.
(I didn’t want to be the guy to write this recommendation because I’m not actually doing development right now so I’m not using it in any serious way, but devenv.sh is the tool in this space that I’m personally most excited about today.
The lovely, lovely, NixOS-like configuration interface is just killer.)