rack-mini-profiler: Not showing in Rails 4

When I include the gem in my rails app the profiler is not shown. However, the javascript is included and the div is created for the widget, but the final content is empty.

I tried adding Rack::MiniProfiler.authorize_request in a before_filter in my application controller: no dice.

I tried creating an initializer and add require: false in the gem file as described in the README: no profiler.

I am using puma, rails 4.0.1, and ruby ruby 2.0.0p247

Any tips?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 2
  • Comments: 34 (5 by maintainers)

Most upvoted comments

Disabling Rack::Deflater in development fixed things for me.

WhateverApp::Application.configure do
  config.middleware.insert_before ActionDispatch::Static, Rack::Deflater
end

Commenting that out and restarting rails s made the profiler work in development on rails 4.2.6 ruby 2.3.1 with the Gemfile-only default setup.

We were missing the badge, and it turned out it was because we were using heroku_rails_deflate. Using heroku-deflater seems to not break the badge.

The problems seem to occur around https://github.com/MiniProfiler/rack-mini-profiler/blob/f580d609677c0792b9685d555ffa7c1378c15787/lib/mini_profiler/profiler.rb#L378 when body turns out not to be a String.

This still happens for me unless I remove oj_mimic_json, which I’d like to use.

I didn’t have the oj_mimic_json gem, but removing heroku-deflator worked for me.

For me, removing Deflater from config/application.rb and moving it to production fixed the issue. As suggested here: http://stackoverflow.com/questions/17025563/how-to-get-mini-profiler-to-start-in-rails

I think I’ve tracked my issue down to a log permissions error. I haven’t bothered to fix it yet though.