Install it in three steps.
A line in your Gemfile, a line in your routes, a bundle install. The toolbar then appears on every HTML page you open in development.
The three steps
- Add the gem to your
Gemfile. The library isprofiler, notrails-profiler: withoutrequire: "profiler", Bundler loads nothing of the gem.gem "rails-profiler", require: "profiler" - Mount the engine in
config/routes.rb, guarded to development.Rails.application.routes.draw do mount Profiler::Engine, at: '/_profiler' if Rails.env.development? end - Run
bundle install, then start your app. The dashboard is at/_profiler.
The gem is published on RubyGems.org. The features page shows what you get, and the FAQ answers the usual questions.
Requirements
- Ruby 3.0 or later. The gem's CI runs its test suite on Ruby 3.3 and 3.4.
- Rails 7.0 or later.
Optional gems
The profiler depends on none of these. Add the ones you use to your application's Gemfile.
stackprof- Function profiling in its default, low-overhead (lite) mode. Without it, lite mode records nothing and the Timeline tab says why.
sqlite3- config.storage = :sqlite
redis- config.storage = :redis (version 5.x)
Safety defaults
The profiler shows everything your application does (parameters, SQL, headers, logs, ENV) and can change ENV and run your tests. Its defaults keep that to you:
- It is disabled outside development and test, unless you enable it.
- Access is
authorization_mode = :allow_localby default: only requests made from the machine itself get in, on every page and endpoint. ENVoverrides saved from the dashboard or MCP are never applied in production.- Sensitive values are masked with your
config.filter_parametersbefore a profile is stored. - There is no CORS, no framing by other sites, no MCP HTTP endpoint and no cluster routes until you turn them on.
Docker, a VM or a remote proxy. Your browser's requests then reach Rails from a bridge or proxy address, which :allow_local refuses, and the profiler stops capturing. Admit your own network explicitly with :allow_authorized and an authorize_with block, as the gem's security documentation shows.