I’ve always liked Homebrew’s bundle command. You can save a snapshot of everything you’ve installed with Homebrew, and then reinstall the snapshot on a new system.
This is a companion discussion topic for the original entry at https://brettterpstra.com/2024/08/01/easily-save-and-restore-gem-executables