Question: I switched to `zsh` from `bash`. I updated the shell in `Preferences > Terminal` settings inside RubyMine.

But, now environment variables are not being loaded inside my Rails application. I can still access them inside the terminal in RubyMine editor!

I tried printing the value of environment variable inside a yml file (where all the DB related environment variables are required). I could access the `home` variable but not custom variables set by me.

Database.yml file:

[![database.yml file](https://i.stack.imgur.com/HqTUr.png)](https://i.stack.imgur.com/HqTUr.png)

Output while starting Rails server in Rubymine:

[![Output while starting Rails server in Rubymine](https://i.stack.imgur.com/dcDCu.png)](https://i.stack.imgur.com/dcDCu.png)

Output inside Rubymine terminal:

[![Output inside Rubymine terminal](https://i.stack.imgur.com/VKT5S.png)](https://i.stack.imgur.com/VKT5S.png)

My `/etc/zshrc`:

[![My zshrc](https://i.stack.imgur.com/X3d3w.png)](https://i.stack.imgur.com/X3d3w.png)

DB settings inside my `vaibhavatul47_zsh_profile.sh` file:

[![DB settings inside my custom profile file](https://i.stack.imgur.com/y3cvE.png)](https://i.stack.imgur.com/y3cvE.png)

Answer: 
Automatic loading Environment variables from `bash` into IntelliJ works while reading and loading from `zsh` doesn't work for `Intellij`.

Starting IntelliJ from Terminal will load environment variables from `zsh` too, please try following:

`open -a "IntelliJ IDEA"`

Note: here `IntelliJ IDEA` is name of my application, in case you have renamed your IntelliJ application to something else please enter that.

Hope this helps!
Check that your env var are loaded correctly in the terminal and then open IDE from the terminal. Then check if the build configuration env vars contains the profile env vars.

Before opening the idea make sure your environment variables are actually loaded when running the terminal:

1. open your zsh profile (vim ~/.zshrc)
2. insert a test env var (something like TEST\_1="mytest")
3. restart the terminal and check if you see TEST\_1 value (echo $TEST\_1)

In case you see TEST\_1 value open intelij idea by entering "idea ."

Now, open your module build configuration and look for the env vars list, check if they contain your zsh env vars (or you can type "echo TEST\_1" in the idea terminal)
gl:)