MiniProfiler not showing up on the page
Asked Answered
C

4

11

I’m having problems getting MiniProfiler to show me the reports. I’m just in the Dev environment, which should show it all the time. Adding ?pp=help does bring up the help page. In tmp/miniprofile, there are a ton of mp_timers_ files. Apparently something is happening back there.

At first I thought it was a weird CSS issue, like my navigation bar is covering it. I tried loading the page without CSS and the MiniProfile box still doesn’t show up.

In case it matters, I do not have a before_filter set up. When I use the simple one from their docs, though, it doesn't help anything.

Cleavland answered 14/8, 2012 at 15:49 Comment(5)
So you're calling Rack::MiniProfiler.authorize_request somewhere in your controller? All I had to do was add the gem, execute the line above in my application controller (in a before_filter) and results started showing in the top-left of my views.Parulis
Yep. I'm calling that in my before_filter. And that's why I'm stumped. It should show up no matter what in the dev environment.Cleavland
Can you try -pre to see if it fixes this ?Farthingale
I had the same problem. In my case it was one of my JS functions not playing nice with it. I'd suggest commenting out all your JS and then reloading your page to see if anything changes?Rosebay
Check out this issue on GitHub, there is a laundry-list of conflicting gems.Jaquelynjaquenetta
K
9

My first thought is that it is disabled by default. If that is the case you will not be able to see the help page. From what you described it seams to be working. So my solutions is to type this into the browser and see what happens.

http://localhost:3000/?pp=enable

after that you should be able to get to help page.

http://localhost:3000/?pp=help
Katharyn answered 6/10, 2014 at 18:24 Comment(4)
OP said they can already see the help page, just not the badge.Jaquelynjaquenetta
More then likely if your not seeing the badge is there is a JavaScript error that renders the information. If using chrome pull up inspector and check the console output for any errors. If there are no errors you will have to check your logs to see if there is anything be rendered for the min profile to render. Last option I can think of that might help is to check your CSS and make sure there are no classes that are making it hidden or direct conflicts with the mini profile tool.Katharyn
If you have a error or something I can backtrack I might be able to give a better answer. Also in some cases you might have to delete the tmp folders in the rails application. Mini profile stores it results in a folder under the tmp director of the rails rootKatharyn
I figured out that if we use pp=disable to disable MiniProfiler temporarily, it will save that configuration somewhere (either cookies or session). Then, it will be disabled by default next times, e.g. http://localhost:3000 will not show the profiler. We need to enable it again http://localhost:3000?pp=enable.Lindquist
L
5

I know this is very late, but another potential issue that may cause this problem is JS errors.

If there are any unresolved JS errors, the badge likely won't show up.

So make sure to squash those before pulling your hair out.

Litmus answered 10/10, 2016 at 0:48 Comment(0)
D
1

I didn't have it show up either due to having an old version of the gem without the currently needed initializer.

To fix it, I just ran the generator which added an initializer to set up rack-mini-profiler in development:

bundle exec rails g rack_profiler:install

Downstream answered 3/6, 2019 at 9:41 Comment(0)
E
0

MiniProfiler can also be set hidden by default

# config/initializers/mini_profiler.rb   
Rack::MiniProfiler.config.start_hidden = true
Edgaredgard answered 19/5, 2021 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.