5

When I run this command

ginkgo bootstrap 

I am getting this error

zsh: command not found: ginkgo 

I have already installed ginkgo using the following command

go get -u github.com/onsi/ginkgo/ginkgo 

I am unable to understand what I am doing wrong?

Usman Sajid
  • 181
  • 2
  • 11
  • "I have already installed ginkgo using the following command `go get -u github.com/onsi/ginkgo/ginkgo`". No you didn't. `go install` is used to install commands. `go get` is used to track dependencies. – Volker Jan 27 '22 at 11:47
  • be sure your `PATH` env variable is configured correctly. See https://stackoverflow.com/a/21012349/2270041 – Matteo Jan 27 '22 at 13:06
  • Even after using go install, the problem persists still. Any idea how to solve this. – Usman Sajid Jan 27 '22 at 15:39
  • be sure you have the `$GOPATH` env variable setted (just `echo $GOPATH` ) and double check the `ginkgo` is located in the `$GOPATH/bin/ginkgo` path – Matteo Jan 27 '22 at 15:46

1 Answers1

14

After installing Ginkgo as described here, for example the latest version:

go env -w GO111MODULE=on
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go get github.com/onsi/gomega/...

Make sure GO bin is in your PATH:

go env GOPATH # /home/user/go
export PATH=$PATH:$(go env GOPATH)/bin

Now try to run Ginkgo:

ginkgo bootstrap
Generating ginkgo test suite bootstrap for temp in:
    temp_suite_test.go
Noam Manos
  • 15,216
  • 3
  • 86
  • 85
  • 1
    this worked for me. i only had to start at the "Make sure GO bin is in your PATH" part. thank you! – tuuk79 May 14 '22 at 13:46