---
title: "Ruby APM with Linux / Windows"
slug: "ruby-apm-with-linux-windows"
updated: 2020-06-19T14:45:32Z
published: 2020-06-19T14:45:33Z
---

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

# Ruby APM with Linux / Windows

This document details how to install the **Ruby APM Profiler** in your **Ruby** application running on **Linux** or **Windows**.

## Prerequisite

- **Linux** - Follow the [Retrace Linux Install](/docs/linux-installation) Guide.
- **Windows** - Follow the [Retrace Windows Install](/docs/net-agent-installation-overview) Guide.

## Ruby Profiler Setup

### Add Stackify APM Module

Modify application `Gemfile`:

```
gem 'stackify-ruby-apm'
```

### Configure Application

Add `config/stackify_apm.yml` to your application, modify **application_name** and **environment_name**.

```
application_name: 'Ruby Application'
environment_name: 'Production'
```

#### Rails

Profiler will startup automatically, no additional configuration.

#### Non-Rails

Include **StackifyRubyAPM::Middleware** when starting your application:

```
# config.ru

require 'stackify-ruby-apm'
use StackifyRubyAPM::Middleware
StackifyRubyAPM.start

# application startup

at_exit { StackifyRubyAPM.stop }
```

#### Sinatra

```
# config.ru

require 'stackify-ruby-apm'
require 'sinatra/base'

class MyApp < Sinatra::Base
  use StackifyRubyAPM::Middleware

  # get '/' do ... 

end

StackifyRubyAPM.start 

run MyApp

at_exit { StackifyRubyAPM.stop }
```

**Build and Deploy your application.**

## Verify

Make application requests, you can then verify results in the Retrace dashboard.

## Troubleshooting

Review the [Troubleshooting Guide](/docs/ruby-apm-troubleshooting).
