I have tried to set these using RCenvironment, .bashrc, .MacOSX/environment.plist and /etc/launchd.conf and restarted computer....IntelliJ is still not picking up my env variables:
Gemfile p "ENVIRONMENT: #{ENV['VAR_PRIVATE_GEM_USERNAME']}" # Outputs "ENVIRONMENT: "
Click edit configurations on the dropdown box for your runtime configurations. Select the runtime you want to add environment variables to. Click environment variables folder icon to pull up the environment variables screen.
app/Contents/Resources/app/bin/ in my case.
See the related questions:
Your question is not specific to IntelliJ IDEA at all.
On Mountain Lion solutions from the first link will not work, so you can do something like this in the Terminal:
export VAR_PRIVATE_GEM_USERNAME=John
open -a /Applications/IntelliJ\ IDEA\ 11.app/
Also note that many Run/Debug configurations in IntelliJ IDEA allow to set custom environment variables:
You can set an environment variable on a Mac that will be available in all apps (not just the command line) by using "launchctl" (see https://ss64.com/osx/launchctl.html)
launchctl setenv VARIABLE_NAME VALUE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With