# Troubleshooting

#### OpenSSL Build Error <a href="#openssl-build-error" id="openssl-build-error"></a>

When running the CLI in a Debian-based Linux environment, you may encounter the following error:

```
Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = aarch64-unknown-linux-gnu
$TARGET = aarch64-unknown-linux-gnu
openssl-sys = 0.9.108
```

This issue occurs because the OpenSSL development libraries are missing. Please execute the following commands to install the required packages.

```
apt update
apt install -y build-essential pkg-config libssl-dev
```

#### Using Rustup Instead of the `apt` Package <a href="#using-rustup-instead-of-the-apt-package" id="using-rustup-instead-of-the-apt-package"></a>

When Rust is installed via `apt install cargo rustc`, you cannot use the **nightly version** of Rust. To enable nightly and other toolchains, please install Rust through **Rustup** instead.

Run the following command:

```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

When prompted during installation, **enter `1`** and press **Enter** to proceed with the default installation.

To make the Rustup-managed Rust toolchain available in your shell, add the following line to your `~/.bashrc`:

```
export PATH="$HOME/.cargo/bin:$PATH"
```

Then apply the changes:

```
source ~/.bashrc
```

Run the following command to confirm that the Rust compiler being used is the one installed via Rustup:

```
which rustc
```

If the output shows:

```
/home/<username>/.cargo/bin/rustc
```

then your configuration is complete and Rustup is now managing your Rust toolchain.

#### How to Fix Environment Variable Loading Errors <a href="#how-to-fix-environment-variable-loading-errors" id="how-to-fix-environment-variable-loading-errors"></a>

When you run the following command:

```
cargo run -r -- claim-builder-reward --eth-private-key <scroll-private-key>
```

you may encounter an error like this:

```
Envy error: unknown variant `production`, expected one of `local`, `dev`, `staging`, `prod`
```

If you have correctly set the environment variables in your `.env` file but this error still occurs, please try running the following command instead. Make sure to replace `<scroll-private-key>` with your actual Scroll private key.

```
( set -a; source .env; set +a; cargo run -r -- claim-builder-reward --eth-private-key <scroll-private-key> )
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://intmax-general.gitbook.io/intmax-developers-hub/intmax-block-building/intmax-block-builder/receive-rewards/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
