direnv: direnv: error .envrc file not found after installing direnv using Snap in zsh
Issue description
I installed direnv using snap and although my .envrc file is present, I cannot load it. I am using oh-my-zsh and can successfully run the direnv command, but I get the error direnv: error .envrc file not found when I try allow or reload even though my .envrc file is definitely there.
Steps to reproduce
- Install direnv using
snap install direnv - Create a .envrc file
- Try to load it.
Technical details
direnv version: 2.18.2- OS release: Ubuntu 18.04
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 34 (2 by maintainers)
Commits related to this issue
- docs: remove Snap from the installations See https://github.com/direnv/direnv/issues/440#issuecomment-672317052 — committed to direnv/direnv by zimbatm 4 years ago
@ipolyzos I forgot to mention that I tried that. I did figure out what the issue was though: I had added the eval to the bottom of my dotfiles configuration that wasn’t loading correctly. I’m now getting this error however:
And when I run
direnv allow .envrcI get this:Any idea what the deal with that is?
I installed direnv from snap and, when I run
direnv hook zshthe response points to:But, when I run
which direnvit points to:Then, on my ~/.zshrc I written the following, instead of the recomended
eval $(direnv hook zsh)And it worked.
@RobRoseKnows if you please add the following line at the end of the ~/.zshrc file:
as per the instructions on https://direnv.net/
Yeah I don’t use the snap anymore tbh. I just installed it from the releases. I would remove the snap from the README though.
The same issue in bash on Ubuntu 20.04.
direnv allowworks with version installed oversudo apt install direnvand doesn’t work with snap package.Hi @RobRoseKnows , the snap has been fixed using classic confinment. I am working with the snapcraft team to allow it in the officially store but takes some time. Till it get available, you can build and use it using the source at https://github.com/ipolyzos/direnv-snap