> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AppSignal for Ruby: Diagnose tool

export const VersionRequirements = ({versions = []}) => {
  if (!Array.isArray(versions) || versions.length === 0) {
    return null;
  }
  const boundaries = {
    upper: " or lower",
    exact: "",
    lower: " or higher"
  };
  const containerStyle = {
    marginTop: "0.5rem",
    marginBottom: "1.5rem"
  };
  const lineStyle = {
    display: "block",
    margin: "0 0 0.35rem 0",
    fontSize: "0.875rem",
    lineHeight: "1.4"
  };
  const pillBaseStyle = {
    display: "inline-block",
    padding: "0.1em 0.4em",
    borderRadius: "0.25rem",
    border: "1px solid",
    fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
    fontSize: "0.85em",
    fontWeight: 500
  };
  const pillColors = {
    "AppSignal for Elixir": {
      background: "#f3e8ff",
      borderColor: "#e9d5ff",
      color: "#9333ea"
    },
    "AppSignal for Front-end": {
      background: "#fef9c3",
      borderColor: "#fde68a",
      color: "#ca8a04"
    },
    "AppSignal for Go": {
      background: "#ccfbf1",
      borderColor: "#99f6e4",
      color: "#0d9488"
    },
    "AppSignal for JavaScript": {
      background: "#fef9c3",
      borderColor: "#fde68a",
      color: "#ca8a04"
    },
    "AppSignal for Node.js": {
      background: "#dcfce7",
      borderColor: "#bbf7d0",
      color: "#16a34a"
    },
    "AppSignal for Python": {
      background: "#dbeafe",
      borderColor: "#bfdbfe",
      color: "#2563eb"
    },
    "AppSignal for Ruby": {
      background: "#fee2e2",
      borderColor: "#fecaca",
      color: "#dc2626"
    },
    "AppSignal for Rust": {
      background: "#ffedd5",
      borderColor: "#fed7aa",
      color: "#ea580c"
    }
  };
  const defaultPillColor = {
    background: "#f4f4f5",
    borderColor: "#e4e4e7",
    color: "#52525b"
  };
  const getPillStyle = name => ({
    ...pillBaseStyle,
    ...pillColors[name] || defaultPillColor
  });
  const getBoundText = bound => {
    return boundaries[bound] || boundaries.lower;
  };
  return <div style={containerStyle}>
      {versions.map((v, i) => <p key={`${v.name}-${v.version}-${v.bound || "lower"}-${i}`} style={lineStyle}>
          This feature requires{" "}
          <code style={getPillStyle(v.name)}>{v.name}</code> version {v.version}
          {getBoundText(v.bound)}.
        </p>)}
    </div>;
};

<VersionRequirements
  versions={[
{ name: "AppSignal for Ruby", version: "1.1.0" }
]}
/>

The AppSignal Ruby gem includes a self-diagnostic tool that can be used to debug the installation and configuration of your AppSignal integration. It is one of the first tools that our support team requests you to run when debugging an issue.

## The diagnostic report

You can use this diagnostic tool to test and validate your AppSignal installation. It outputs useful information to debug issues and it checks if AppSignal agent is able to run on the machine's architecture and communicate with the AppSignal servers.

This diagnostic tool collects and outputs the following:

* Information about the AppSignal gem.
* Information about the host system and Ruby.
* If the AppSignal [extension](/appsignal/how-appsignal-operates#extension) and [agent](/appsignal/how-appsignal-operates#agent) can run on the host system.
* All configured config options (including default values).
* If the configuration is valid and active.
* If the Push API key is present and valid (internet connection required).
* Where configuration option values originate from.
* If the required system paths exist, are writable, and which user and group are owners.
* Small parts of the tail from the available log files.

You can read more about how to use the diagnose command in our [Debugging](/support/debugging) documentation.

## Submitting the report

In gem version `2.2.0` and higher you will be prompted to send the report to AppSignal. If accepted the report will be send to our servers and you will receive a support token.

When you [send this support token to us](mailto:support@appsignal.com) we will review the report and help you debug the issue. We've seen that copy-pasting the report output usually loses formatting and makes it harder to read, which is why it's send to our servers in the JSON format.

In gem version `2.8.0` the option was added to view the report yourself on AppSignal.com. A link to the report is printed in the diagnose output. This web view will also show any validation problems and warnings our system detected.

## Usage

On the command-line in your project run:

<CodeGroup>
  ```bash Bash theme={null}
  appsignal diagnose
  ```
</CodeGroup>

If you're experiencing an issue in production and need to send the report to AppSignal for support, you can run the following command to generate and send the report to our servers:

<CodeGroup>
  ```bash Bash theme={null}
  bundle exec appsignal diagnose --environment=production --send-report
  ```
</CodeGroup>

## Options

| Option                                               | Description                                                                |
| ---------------------------------------------------- | -------------------------------------------------------------------------- |
| [`--environment=<environment>`](#environment-option) | Set the environment to use in the command, e.g. `production` or `staging`. |
| [`--[no-]send-report`](#report-submission-option)    | Automatically send, or do not send the report.                             |
| `--[no-]color`                                       | Toggle the colorization of the output.                                     |

### Environment option

To select a specific environment with the CLI, run the below command:

<CodeGroup>
  ```bash Bash theme={null}
  appsignal diagnose --environment=production
  ```
</CodeGroup>

The environment option is useful when there is no default environment (non-Rails apps and apps configured with an [config file](/ruby/configuration/load-order#file)) or the default environment is not the one you want to diagnose. The diagnose tool will warn you when no environment is selected.

### Report submission option

The options to [submit the report](#submitting-the-report) immediately, or not, were added to the AppSignal gem version `2.8.0`. Selecting whether or not to send the report with these options will no longer prompt this question, making it easier to use in non-interactive environments.

To run diagnose and submit the report data to AppSignal, run the below command:

<CodeGroup>
  ```bash Bash theme={null}
  appsignal diagnose --send-report
  ```
</CodeGroup>

To run diagnose without sending the report data to AppSignal, run the below command:

<CodeGroup>
  ```bash Bash theme={null}
  appsignal diagnose --no-send-report
  ```
</CodeGroup>

## Configuration output format

### Configuration option values format

The configuration options are printed to the CLI as their inspected values. This means we print them as Ruby would in a console.

* Strings values are printed with double quotes around them, e.g. `"My app name"`.
* Booleans values are printed as their raw values: `true` and `false`.
* Arrays values are printed as a collection of values surrounded by square brackets, e.g. `["HTTP_ACCEPT", "HTTP_ACCEPT_CHARSET"]`.
  * Empty Arrays are printed as two square brackets: `[]`.
* Nil values are printed as `nil`.

### Configuration sources

The configuration section also displays the origin of config option values, which can help identify sources that override values defined in other config sources.

You can read more about configuration sources their load order, and priority in the [configuration load order](/ruby/configuration/load-order) documentation.

The configuration options are displayed based on the source of their values and the number of sources that set them, like in the below example:

```text Shell theme={null}
Configuration
  # Option with a value loaded only from the default source
  send_params: true

  # Option with one source
  # A different source than the default source
  name: "My app name" (Loaded from file)

  # Option with multiple sources
  # Listed in order of priority (highest priority last)
  active: true
    Sources:
      default: false
      file:    false
      env:     true
```

[debugging]: /support/debugging.html
