Skip to content

Commit

Permalink
docs: Add dedicated issues section to the installation page
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto committed Oct 19, 2024
1 parent b6724d2 commit 817111f
Showing 1 changed file with 41 additions and 21 deletions.
62 changes: 41 additions & 21 deletions docs/src/pages/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,6 @@ On Linux systems you may need to install additional dependencies if cargo instal
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev
```

If you're using `bash`, add `avm` to PATH for `bash`, then reload the shell:

```shell
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

If you're using `fish`, add `avm` to PATH for `fish`, then reload the shell:

```shell
echo "set -gx PATH \$PATH \$HOME/.cargo/bin" >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish
```

If you're using `zsh`, add `avm` to PATH for `zsh`, then reload the shell:

```shell
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

Install the latest version of the CLI using `avm`, and then set it to be the version to use.

```shell
Expand Down Expand Up @@ -99,6 +78,47 @@ Now verify the CLI is installed properly.
anchor --version
```

## Issues

### Incorrect `$PATH`

Rust binaries, including `avm` and `anchor`, are installed to the `~/.cargo/bin` directory. Since this directory is required to be in the `PATH` environment variable, [Rust](#rust) installation tries to set it up automatically, but it might fail to do so in some platforms.

To verify that the `PATH` environment variable was set up correctly, run:

```shell
which anchor
```

the output should look like (with your username):

```
/home/user/.cargo/bin/anchor
```

If the command fails or the output is empty, make sure to add the `~/.cargo/bin` directory to the `PATH` environment variable.

#### Bash

```shell
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

#### Fish

```shell
echo "set -gx PATH \$PATH \$HOME/.cargo/bin" >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish
```

#### Zsh

```shell
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

## Generating Shell Completions

Shell completions can be generated for `bash`, `elvish`, `fish`, `powershell`, and `zsh`.
Expand Down

0 comments on commit 817111f

Please sign in to comment.