• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Install the New Relic Ruby agent

|View as Markdown

The Ruby agent auto-instruments your code so you can start monitoring applications.

Tip

Running on Kubernetes? See Kubernetes APM auto-attach.

Prerequisites

Check these requirements before you start.

Requirement

Details

New Relic account

You need a New Relic account and your . Have it ready before you begin.

Ruby version

See Ruby agent requirements and supported frameworks for supported Ruby versions.

Operating system

UNIX-like operating systems: Linux, Solaris, FreeBSD, and macOS. See Ruby agent requirements and supported frameworks for details.

Install the gem

Add the Ruby agent gem to your Gemfile:

gem 'newrelic_rpm'

Then run:

bash
$
bundle install

Important

If you are using the agent in a Docker container, install the agent within each container. See Install in GAE flexible environment for a Docker-based deployment example.

Framework-specific notes:

  • Rails: Rails automatically calls Bundler.require, so newrelic_rpm is required during startup with no additional steps.
  • Roda or Sinatra: You must manually call require 'newrelic_rpm' in your application.
  • Other Rack apps: To use automatic browser monitoring, manually include the Rack middlewares provided by the agent.

Configure the agent

Download newrelic.yml from the New Relic GitHub repository and copy it into the config directory of your application.

The only two settings you must change before going live:

  1. Set license_key to your .

  2. Set app_name to a meaningful name for your application.

    Alternatively, generate the config file with the CLI:

    bash
    $
    newrelic install --license_key="YOUR_LICENSE_KEY" "YOUR_APP_NAME"

Verify data is flowing

  1. Restart your web server.

  2. Send at least two requests to your application.

  3. Wait 2–3 minutes, then open one.newrelic.com > APM and look for your app by name.

    Tip

    App not appearing? See No data appears (Ruby).

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.