Heroku "go:command not found" when using one-off dyno

451 Views Asked by At

I'm trying to use heroku one-off dyno to run golang code, but I get bash: go: command not found in heroku run.

My app directory is like below.
myapp
├── vendor/vendor.json
├── main.go
├── Procfile
└── .gitignore

I created heroku application using

heroku create myapp --buildpack https://github.com/heroku/heroku-buildpack-go.git

and Procfile is

web: bin/myapp

vendor.json is

{ 
  "package": [
    ...
  ],
  "rootPath": "myapp",
  "heroku": {
      "install" : ["./..."],
      "goVersion": "go1.14.6"
  }
}

After I succeeded deploying my app, I tried to use one-off dyno, but I couldn't use go command.

heroku run bash
~ $ go version
bash: go command not found

Can someone help me use go command?

0

There are 0 best solutions below