Install or update to the latest Ruby agent (version 3.0.1 or higher). See these instructions to update your agent.
In your application settings, enable end user monitoring.

Note you can use this switch to turn end user monitoring on/off for your application. When off, the agent will not instrument pages with monitoring scripts and New Relic will stop collecting end user data.
Automatic instrumentation works with Rack, and therefore requires Rails 2.3 or greater.
Configure the agent to automatically instrument pages with end user monitoring scripts, by adding or editing the following flag in newrelic.yml.
browser_monitoring:
auto_instrument: true
This is the simplest way to monitor end users. The agent examines each page from your application and automatically injects JavaScript in the header and footer of the page. Auto-instrumentation works for environments that support Rack. If this approach fails to correctly instrument your application’s pages then you’ll need to use the manual method described in the next section.
The default value of auto-instrument is true (even when unspecified). To disable auto-instrumentation you must set this flag to false.
If you are using Rails 2.0 to 2.2 or for some other reason you can't use auto-instrumentation, end user monitoring can still be used by manually including appropriate scripts in your pages. The New Relic agent has an API to generate the headers and footers that need to be inserted into your pages.
For example, you could modify your application's template to make calls to the agent as follows:
<head>
<%= NewRelic::Agent.browser_timing_header rescue "" %>
... existing template code ...
<%= NewRelic::Agent.browser_timing_footer rescue "" %>
</body>
If you do not see any Real User data being reported, view the HTML source and check for something similar to:
<script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script>
in your HTML head. If this is not present, check to make sure that you are not using manual instrumentation when you have auto instrumentation turned on. There is currently a known bug that causes Real User Monitoring to be disabled in this case.