Skip to content

Troubleshooting your warp installation

Stanislas Polu edited this page Apr 23, 2017 · 10 revisions

From source code

If Go is properly configured, installing warp should be as simple as running:

go get -u github.com/spolu/warp/client/cmd/warp

Troubleshooting

Does go version return something?

If not, please install Go.

Installing Go

Follow the instructions from Go's Getting Started. If your version is below 1.7.x, you should consider upgrading Go.

Upgrading Go

Go generally installs itself under one directory generally stored in the environment variable $GOROOT. To upgrade Go, you want to delete your $GOROOT (generally /usr/local/go). You can find your $GOROOT (if not set as an environment variable) by running which go (generally returns /usr/local/go/bin/go, meaning here that your $GOROOT is /usr/local/go as expected). To delete your $GOROOT you'll want to run the following command as root or using sudo:

# Nothing other than the Go distribution is generally stored under `$GOROOT`,
# so it's safe to delete. But you should consider saving it beforehand if you
# have a doubt.

rm -rf /usr/local/go

You can then follow the instructions from Go's Getting Started.

Does echo $GOPATH return something?

Setting up your $GOPATH

Your $GOPATH is the directory where Go will import projects source code and store compiled go binaries. Starting with Go 1.7.x it defaults to ~/go but we recommend you to set your $GOPATH nonetheless.

If you don't have a ~/go directory, create it with:

# You can also pick another directory as $GOPATH.

mkdir ~/go

Then edit your .bashrc (Linux) or .profile (Mac) and add the following:

# If you picked another directory, set it here as $GOPATH.

export GOPATH=~/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

This will set your $GOPATH whenever you start a terminal and will also add $GOPATH/bin in your $PATH such that you'll be able to run all programs built and installed by Go sources from anywhere.

Finally, you should restart your terminal and run the warp installation command again:

go get -u github.com/spolu/warp/client/cmd/warp

After it succeeds, a warp binary should be present under $GOPATH/bin and you should be able to run warp from anywhere.

Installation worked but I can't run warp?

This probably means that your $GOPATH is not properly setup. Follow the instructions in the section above: Setting up your $GOPATH.