> ## 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.

# Integrating AppSignal in Ruby

It's possible that AppSignal does not provide automatic integration for your
framework of choice, or maybe you're using your own application setup.

See our [list of supported integrations](/ruby/integrations) to see
what frameworks and gems we support with the AppSignal gem.

When AppSignal does not support your application automatically, it's still possible to add AppSignal instrumentation. Our Ruby gem needs to be configured and started once at the beginning of a process. It can be [configured](/ruby/configuration) through a configuration file or by using environment variables.

## Configuration

### Environment variables

When using [environment variables](/ruby/configuration/load-order#environment-variables) to configure AppSignal the gem will read the configuration from the environment once it starts. Calling `Appsignal.start` is enough.

<CodeGroup>
  ```ruby Ruby theme={null}
  require "appsignal"

  # Load your app

  Appsignal.start
  ```
</CodeGroup>

### Configuration file

When using a [configuration file](/ruby/configuration#ruby-configuration-file) to configure AppSignal, the Ruby gem needs to be configured before it is started.
It will look for the `config/appsignal.rb` file in the current working directory of the application process.
Alternatively, it can also be configured using the [`Appsignal.configure` helper](/ruby/configuration#appsignalconfigure-helper) as shown in the example below.

<CodeGroup>
  ```ruby Ruby theme={null}
  require "appsignal" # Require the AppSignal gem

  # Optional: load integrations manually
  # These integrations need to be loaded before `Appsignal.configure` is called.
  # Appsignal.load(:sinatra)

  # Optional: Configure AppSignal via the configure helper
  # Appsignal.configure do |config|
  #   # Some config
  # end

  # Lastly, start AppSignal
  Appsignal.start
  ```
</CodeGroup>

AppSignal will look in the path of the first argument for a `config/` directory containing an `appsignal.rb` file to load the configuration.
The second argument is the environment it will load from the configuration file.

## Next steps

Continue with our [instrumentation for scripts and background jobs guide](/ruby/instrumentation/background-jobs) for applications that we don't automatically instrument. Use [instrumentation helpers](/ruby/instrumentation/instrumentation) to break down the instrumented code in more detail.
