diff options
| author | mo8it <mo8it@proton.me> | 2025-05-17 15:49:26 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2025-05-17 15:49:26 +0200 |
| commit | f387f4c1d9d5a2b7b78d454e16a180f49bc63d1c (patch) | |
| tree | a3b05961b954503e959d92b56a3acb0d315f56f9 /website/content/setup | |
| parent | b30973afa1d76bdbeb1104cc662db4f27407c805 (diff) | |
Add setup and usage pages
Diffstat (limited to 'website/content/setup')
| -rw-r--r-- | website/content/setup/index.md | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/website/content/setup/index.md b/website/content/setup/index.md new file mode 100644 index 0000000..7e628f8 --- /dev/null +++ b/website/content/setup/index.md @@ -0,0 +1,77 @@ ++++ +title = "Setup" ++++ + +<!-- toc --> + +## Installing Rust + +Before installing Rustlings, you need to have the **latest version of Rust** installed. +Visit [www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) for further instructions on installing Rust. +This will also install _Cargo_, Rust's package/project manager. + +> 🐧 If you are on Linux, make sure you have installed `gcc` (for a linker). +> +> Deb: `sudo apt install gcc` +> +> Dnf: `sudo dnf install gcc` + +> 🍎 If you are on MacOS, make sure you have installed Xcode and its developer tools by running `xcode-select --install`. + +## Installing Rustlings + +The following command will download and compile Rustlings: + +```bash +cargo install rustlings +``` + +<details> +<summary><strong>If the installation fails…</strong> (<em>click to expand</em>)</summary> + +> - Make sure you have the latest Rust version by running `rustup update` +> - Try adding the `--locked` flag: `cargo install rustlings --locked` +> - Otherwise, please [report the issue](https://github.com/rust-lang/rustlings/issues/new) + +</details> + +## Initialization + +After installing Rustlings, run the following command to initialize the `rustlings/` directory: + +```bash +rustlings init +``` + +<details> +<summary><strong>If the command <code>rustlings</code> can't be found…</strong> (<em>click to expand</em>)</summary> + +> You are probably using Linux and installed Rust using your package manager. +> +> Cargo installs binaries to the directory `~/.cargo/bin`. +> Sadly, package managers often don't add `~/.cargo/bin` to your `PATH` environment variable. +> +> - Either add `~/.cargo/bin` manually to `PATH` +> - Or uninstall Rust from the package manager and [install it using the official way with `rustup`](https://www.rust-lang.org/tools/install) + +</details> + +Now, go into the newly initialized directory and launch Rustlings for further instructions on getting started with the exercises: + +```bash +cd rustlings/ +rustlings +``` + +## Working environment + +### Editor + +Our general recommendation is [VS Code](https://code.visualstudio.com/) with the [rust-analyzer plugin](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer). +But any editor that supports [rust-analyzer](https://rust-analyzer.github.io/) should be enough for working on the exercises. + +### Terminal + +While working with Rustlings, please use a modern terminal for the best user experience. +The default terminal on Linux and Mac should be sufficient. +On Windows, we recommend the [Windows Terminal](https://aka.ms/terminal). |
