The problem of replicating environments was already a solved issue for me. When I'm setting up an environment for the first time, I make note of all of the commands required to set it up and put them in a shell script. I guess it's nice to not have to tweak them when there's an OS upgrade.
The other side of solving this is writing tests to check that, for instance, a particular language extension is loaded. The application should be throwing a fit if something is missing in the environment.