3
votes

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

Output while starting Rails server in Rubymine:

Output while starting Rails server in Rubymine

Output inside Rubymine terminal:

Output inside Rubymine terminal

My /etc/zshrc:

My zshrc

DB settings inside my vaibhavatul47_zsh_profile.sh file:

DB settings inside my custom profile file

1
switched back to bash for now. Things working fine again. - vaibhavatul47
Did you restart RubyMine after preference update? - AVokin
yes, i did restarted. - vaibhavatul47
Report to youtrack.jetbrains.com/issues/RUBY with full textual output from Console when you starting the Run/Debug Configuration and project configuration files attached. - Andrey
Did you ever find a solution? - Jaap

1 Answers

2
votes

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!