Copy and paste the following commands:
# Clone the ksonnet repo into your GOPATH
go get github.com/ksonnet/ksonnet
# Build and install binary under shortname `ks` into $GOPATH/bin
cd $GOPATH/src/github.com/ksonnet/ksonnet
make install
If your ksonnet is properly installed, you should be able to run ks --help
and see output describing the various ks
commands.
-
If your error is "open /bin/ks: operation not permitted", ensure that your
$GOPATH
is set appropriately. Ifecho $GOPATH
results in empty output, you'll need to set it. If you're using macOS, trying adding the lineexport GOPATH=$HOME/go
to the end of your$HOME/.bash_profile
.Other systems may have different
$GOPATH
defaults (e.g./usr/local/go
), in which case you should use those instead. (If you get stuck, these instructions may help).The ksonnet Makefile assumes you have one and only one directory in your
$GOPATH
. -
You may need to specify your
$GOPATH
in the same command asmake install
. For example, tryGOPATH=<your-go-path> make install
(making sure to replace<your-go-path>
), instead of justmake install
. -
If your error is "command not found", make sure that Go binaries are included in your $PATH. You can do this by running
PATH=$PATH:$GOPATH/bin
. -
You need to use go over 1.10 version Use
go version
to check it.