参考 : https://github.com/MiniProfiler/rack-mini-profiler
以及: 这个: 特别有意思, 写的特别好: https://stackify.com/rack-mini-profiler-a-complete-guide-on-rails-performance/
1. Gemfile: gem 'rack-mini-profiler', require: false
2 bundle exec rails g rack_profiler:install
会生成文件 config/initializers/rack_profiler.rb 内容如下:
if Rails.env.development? require "rack-mini-profiler" # initialization is skipped so trigger it Rack::MiniProfilerRails.initialize!(Rails.application) end