Skip to content

Commit 0f031e1

Browse files
committed
add more troubleshooting to the readme
1 parent f8f69d2 commit 0f031e1

File tree

1 file changed

+50
-20
lines changed

1 file changed

+50
-20
lines changed

README.md

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,31 @@ The official command line tool for [Boot.dev](https://www.boot.dev). It allows y
1010

1111
## Installation
1212

13-
### 1. You need Go 1.22 installed
13+
### 1. Install Go 1.22 or later
1414

15-
The Boot.dev CLI only works on Linux and Mac. If you're on Windows, you'll need to use WSL. Make sure you install go in your Linux/WSL terminal, not your Windows terminal/UI. You can use the [webi instructions here](https://webinstall.dev/golang/) for a quick and easy Go installation on the command line. To do so, run this in your terminal:
15+
The Boot.dev CLI requires a Golang installation, and only works on Linux and Mac. If you're on Windows, you'll need to use WSL. Make sure you install go in your Linux/WSL terminal, not your Windows terminal/UI. There are two options:
16+
17+
**Option 1**: [The webi installer](https://webinstall.dev/golang/) is the simplest way for most people. Just run this in your terminal:
1618

1719
```bash
1820
curl -sS https://webi.sh/golang | sh
1921
```
2022

21-
*Be sure to read the output of the command and follow any instructions. You might need to update your PATH.*
23+
_read the output of the command and follow any instructions. You might need to update your PATH._
2224

23-
Alternatively, you can use the [official installation instructions](https://go.dev/doc/install).
25+
**Option 2**: Use the [official installation instructions](https://go.dev/doc/install).
2426

2527
Run `go version` on your command line to make sure the installation worked.
2628

29+
**Troubleshooting:**
30+
31+
- If you already had Go installed with webi, you should be able to run the same webi command to update it.
32+
- If you already had a version of Go installed a different way, you can use `which go` to find out where it is installed, and remove the old version manually.
33+
- Check the "troubleshooting command not found" section below if that's the error you're getting.
34+
2735
### 2. Install the Boot.dev CLI
2836

29-
This command will download, build, and install the `bootdev` command into your Go toolchain's `bin` directory. Go ahread and run it:
37+
This command will download, build, and install the `bootdev` command into your Go toolchain's `bin` directory. Go ahead and run it:
3038

3139
```bash
3240
go install github.com/bootdotdev/bootdev@latest
@@ -38,34 +46,56 @@ Make sure that it works by running:
3846
bootdev help
3947
```
4048

41-
### 3. Add to PATH (if you're having issues)
49+
If you're having issues, check the "troubleshooting command not found" section below.
4250

43-
If you're getting a "command not found" error, it's most likely because Go's bin directory (where your `bootdev` command is) isn't in your PATH. You can add the bin directory to your PATH by modifying your shell's configuration file. For example, if you're using bash on Ubuntu (e.g. WSL), you can run the following commands to add a line to your `~/.bashrc` file:
51+
### 3. Login to the CLI
4452

45-
```bash
46-
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.bashrc
53+
Run `bootdev login` to authenticate with your Boot.dev account. After authenticating, you're ready to go!
54+
55+
### Troubleshooting "command not found"
56+
57+
If you're getting a "command not found" error for either the `go version` or the `bootdev help`, it's most likely because the directory containing the `go` binary isn't in your [`PATH`](https://opensource.com/article/17/6/set-path-linux). You can add the bin directory to your `PATH` by modifying your shell's configuration file. _Also, be sure to read the output of any installation commands you run, as they likely contain important info._
4758

59+
**PATH issues with Go itself**:
60+
61+
You need to know _where_ the `go` command was installed. It might be in:
62+
63+
- `~/.local/opt/go/bin` (webi)
64+
- `/usr/local/go/bin` (official installation)
65+
- somewhere else?
66+
67+
You should be able to ensure it exists by attempting to run `go` with the full filepath. For example, if you think it's in `~/.local/opt/go/bin`, you can run `~/.local/opt/go/bin/go version`. If that works, then you just need to add `~/.local/opt/go/bin` to your `PATH` and reload your shell:
68+
69+
```bash
70+
# For Linux/WSL
71+
echo 'export PATH=$PATH:$HOME/.local/opt/go/bin' >> ~/.bashrc
4872
# next, reload your shell configuration
4973
source ~/.bashrc
5074
```
5175

52-
Or if you're on Mac OS using zsh:
53-
5476
```bash
55-
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc
56-
77+
# For Mac OS
78+
echo 'export PATH=$PATH:$HOME/.local/opt/go/bin' >> ~/.zshrc
5779
# next, reload your shell configuration
5880
source ~/.zshrc
5981
```
6082

61-
## Usage
83+
_Use the correct shell configuration file for your shell, and the correct path to your Go installation._
6284

63-
The first time you use the tool, run `bootdev login` to authenticate with your Boot.dev account. Here are the other commands:
85+
**PATH issues with the Boot.dev CLI**:
6486

65-
* `bootdev login` - Login to [Boot.dev](https://www.boot.dev). You'll need to login to Boot.dev in your browser and copy/paste a token.
66-
* `bootdev logout` - Logout of Boot.dev (clears your authentication token).
67-
* `bootdev run <id>` - Run a lesson locally to debug your solution.
68-
* `bootdev submit <id>` - Submit a lesson to Boot.dev.
87+
You probably need to add `$HOME/go/bin` (the default `GOBIN` directory where `go` installs programs) to your `PATH`:
6988

70-
After a `submit` command, results are sent to Boot.dev's servers, and then websocketed to your browser instantly, so be sure to check there after submission.
89+
```bash
90+
# For Linux/WSL
91+
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.bashrc
92+
# next, reload your shell configuration
93+
source ~/.bashrc
94+
```
7195

96+
```bash
97+
# For Mac OS
98+
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc
99+
# next, reload your shell configuration
100+
source ~/.zshrc
101+
```

0 commit comments

Comments
 (0)