Rider cannot see all Environmental Variables
Hi
I've added some environmental variables to system level - they're not visible in Rider - (I was resetting rider and whole machine/OS)
The list in Rider is shorter than the one in system settings.
I know I can add those variables in upper window - but why Rider doesn't get system level vars?
And I want to stress again that IDE was restarted and local system was also restarted.
Thanks Michal
Please sign in to leave a comment.
Hi Michal Szilder!
Thanks for contacting us. If you run Rider via Toolbox, please restart also Toolbox after setting a new variable. I double-checked on the latest Rider 2022.1.1 version and it should work. Please let me know if you have another experience.
Thanks!
When I start Rider 2022.2.1 (not via Toolbox) it does not have access to many environment variables defined in either .bashrc or .zshrc.
Ok I wasn't using toolbox at all. Does it change anything when started using toolbox or toolbox is uninstalled?
Hi Kris!
As I can see, you've already contacted us privately. Our team will prepare the answer soon.
Michal Szilder, if you have Toolbox, you need to restart both Rider and Toolbox to pick up new environment variables. If you don't have it installed, only IDE should be restarted. If there is still an issue, could you please clarify how you add new environment variables?
Thanks!
Michal Szilder did you manage to fix the issue? If yes please share the HowTo. Because my Rider still cannot see variables defined in .bash_profile
Thanks in advance
Hi Slava S!
Unfortunately, this is a known issue: Rider can't load interactive shell environment variables. As a workaround, add your environment variable to etc/environment/ and restart Rider.
I hope this helps!
Note to anyone trying Alexandra Guk's solution, from my experience incorporating it:
If you lack root perms to change /etc/environment:
- modify the .desktop file created at install
- add your env exports to the profile according to your shell
- add `/bin/yourshell -c` before the startup script invocation
- ex: Exec=/bin/yourshell -c "/home/youruser/.local/share/JetBrains/Toolbox/apps/Rider/ch-0/231.9011.39/bin/rider.sh"
- create an env file to export your variables
- modify the rider.sh launch script to source your env file on launch
- ex: source /path/to/mycustomvars.env
These solutions have the following drawbacks:
- will not survive updates, you'll need to reapply each time you update
- super manual, lots of potential for user error, esp in team scenarios