简体   繁体   中英

Direnv not allowing me to allow

I've installed direnv (v2.18.2) onto my Ubuntu 16.04 machine using:

sudo snap install direnv

as per the website, and added the line:

eval "$(direnv hook bash)"

to my ~/.bashrc file as per the instructions. When I navigate into the directory with my .envrc file, the following message shown:

direnv: error .envrc is blocked. Run `direnv allow` to approve its content.

Sweet. So I run direnv allow , and I'm immediately hit with exactly the same error. I've also tried using direnv allow . but that doesn't seem to help. Also, completely restarting my laptop hasn't helped either.

All the advice I've seen is for direnv not finding the .envrc file, but here it is finding it, it's just not allowing me to allow it.

I know this is not a propper solution, but I encountered this aftering installing from a snap on Linux Mint.

After I uninstalled the snap and installed it from aptitude I did not have any issues.

While the OP is on Ubuntu I ran into the same problem with the snap installed binary on CentOS 7.7.

I worked around the problem by installing a go binary and then building direnv from source: git clone https://github.com/direnv/direnv.git; cd direnv; make; make install git clone https://github.com/direnv/direnv.git; cd direnv; make; make install git clone https://github.com/direnv/direnv.git; cd direnv; make; make install which got me direnv 2.21.2 in /usr/local/bin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM