This method is for installing the Ruby agent as a Rails plugin for Rails 2 or higher.
Important
For most use cases, install the Ruby agent as a gem instead. The gem method provides better control over versions and dependencies.
Prerequisites
Requirement | Details |
|---|---|
New Relic account | You need a New Relic account and your . |
Ruby and Rails version | See Ruby agent requirements and supported frameworks for supported versions. |
Git | Git must be accessible from the command line to install from GitHub. |
Install the Rails plugin
Install the plugin from GitHub into your application's vendor/plugins directory:
$script/plugin install git://github.com/newrelic/newrelic-ruby-agent.git$mv vendor/plugins/rpm vendor/plugins/newrelic-ruby-agentIf you cannot install directly from the git URL, clone the repository into the vendor/plugins directory manually.
Configure the agent
Copy the newrelic.yml file from the plugin directory into your application's config subdirectory:
$cp vendor/plugins/newrelic-ruby-agent/newrelic.yml config/newrelic.ymlEdit config/newrelic.yml and set the two required values:
- Set
license_keyto your . - Set
app_nameto a meaningful name for your application.
For all other configuration options, see Ruby agent configuration.
Verify data is flowing
Restart your web server, then send at least two requests to your application. Wait 2–3 minutes and open one.newrelic.com > APM to look for your app by name.
Tip
App not appearing? See No data appears (Ruby).
Related articles
- Install the Ruby agent as a gem — Recommended method for most use cases.
- Ruby agent requirements and supported frameworks — Supported Ruby and Rails versions.
- Ruby agent configuration — All available configuration settings.