Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

bash: envsubst: command not found #101

Open
ziadsawalha opened this issue Sep 1, 2022 · 1 comment
Open

bash: envsubst: command not found #101

ziadsawalha opened this issue Sep 1, 2022 · 1 comment

Comments

@ziadsawalha
Copy link

On an M1 Mac running Monterey, I get this error during step 4 of the Kubernetes and Docker example:

$ plz build 
Build stopped after 60ms. 2 targets failed:
    //hello_service/k8s:_k8s#service_yaml
Error building target //hello_service/k8s:_k8s#service_yaml: exit status 127
bash: envsubst: command not found

    //hello_service/k8s:_k8s#deployment_yaml
Error building target //hello_service/k8s:_k8s#deployment_yaml: exit status 127
bash: envsubst: command not found

I get it to work if I change this line to point to my Brew-installed gettext package:
cmd = exports + [f"cat $SRCS | {replacement_command} | /opt/homebrew/Cellar/gettext/0.21/bin/envsubst '{envsubst_vars}' > $OUT"],

That's as far as I got troubleshooting this (sorry, not much experience with Go).

Where does plz get its shell environment from? I can't seem to fix this with any aliasing in my terminal files (ex. .zshrc, .profile, etc...)

Originally posted by @ziadsawalha in #55 (comment)

@ziadsawalha ziadsawalha changed the title On an M1 Mac running Monterey, I get this error during step 4 of the [Kubernetes and Docker example](https://please.build/codelabs/k8s/#4): bash: envsubst: command not found Sep 1, 2022
@PeterBocan
Copy link

Hi, you need to link the envsubst into /usr/local/bin like so:

sudo ln -s /opt/homebrew/bin/envsubst /usr/local/bin/envsubst

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants