Reputation: 2895
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:
Output while starting Rails server in Rubymine:
Output inside Rubymine terminal:
My /etc/zshrc
:
DB settings inside my vaibhavatul47_zsh_profile.sh
file:
Upvotes: 3
Views: 5161
Reputation: 750
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:
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:)
Upvotes: 0
Reputation: 1955
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!
Upvotes: 4