the easiest solution, in my experience, is to set your environment variables in your .Rprofile instead of using the system. In Mac different settings get set depending on where you start an application. But R will always run your .Rprofile (unless you explicitly tell it not to).
you can set environment variables with something like this in the .Rprofile:
Sys.setenv(MYVARIABLE = 'my_value')