Installation

Raygun’s support for Ruby APM will allow you to profile your Ruby or Ruby on Rails application. Ruby teams can now get end-to-end monitoring with features like detailed trace transactions, dashboards, user experience monitoring and more.

It’s as simple as installing our Agent and the appropriate Ruby gem.


Installation instructions for Ruby

Supported Ruby versions

The profiler only supports CRuby, also known as Matz’s Ruby Interpreter (MRI).

  • 2.5.x
  • 2.6.x
  • 2.7.x

Contact us to support other Ruby versions.

1. Install the agent

Follow the agent installation instructions for your environment.

2. Set up Profiling

Include this gem in your Gemfile:

gem 'raygun-apm'

To avoid profiling test data, only enable profiling for your production environment:

group :production do
  gem 'raygun-apm'
end

Run bundle to install the gem.

Alternatively, install it using rubygems:

gem install raygun-apm

See the Ruby Profiler documentation for more information.


Installation instructions for Ruby on Rails

Supported Ruby versions:

The profiler only supports CRuby, also known as Matz’s Ruby Interpreter (MRI).

  • 2.4.x (End of life upstream release that does not receive backports anymore)
  • 2.5.x
  • 2.6.x
  • 2.7.x (Preview release, still officially unreleased, but supported)

Supported Ruby on Rails versions:

Rails 4 and up.

  • Rails 4.x
  • Rails 5.x
  • Rails 6.x

Contact us to support other Ruby on Rails versions.

1. Install the agent

Follow the agent installation instructions for your environment.

2. Set up Profiling

Include this gem in your Gemfile:

gem 'raygun-apm-rails'

To avoid profiling test data, only enable profiling for your production environment:

group :production do
  gem 'raygun-apm-rails'
end

Run bundle to install the gem.

Alternatively, install it using rubygems:

gem install raygun-apm-rails

See the Ruby Profiler documentation for more information.


Installation instructions for Sidekiq

If you are using Sidekiq, include the Sidekiq gem alongside the Ruby on Rails gem:

group :production do
  gem 'raygun-apm-rails'
  gem 'raygun-apm-sidekiq'
end

Alternatively, install it using rubygems:

gem install raygun-apm-sidekiq

Installation instructions for Heroku buildpack

This buildpack installs the Raygun APM agent on your dyno, and starts it after every deploy. To collect data from a Ruby application, you also need the relevant Ruby gem (raygun-apm-rails for a Rails app, raygun-apm otherwise) to your Gemfile.

If you’ve never deployed your Rails project on Heroku before, please consult the Getting Started on Heroku with Rails guide first to get started.

Navigate to the directory of your project:

cd <YOUR RUBY/RAILS PROJECT>

Initialize a new Heroku project:

heroku create

Add the Ruby buildpack:

heroku buildpacks:add heroku/ruby

Add the Raygun APM buildpack:

heroku buildpacks:set https://github.com/MindscapeHQ/heroku-buildpack-raygun-apm

Add your APM API key to your application configuration:

heroku config:add RAYGUN_API_KEY=<YOUR RAYGUN API KEY>

Deploy to Heroku:

git push heroku master


Troubleshooting

Having trouble receiving traces? Please look at our troubleshooting guide.