MiniProfiler does not hook in to the asset pipeline

My config:

My ApplicationController:

Using the latest gem version of mini profiler (is there a way for me to use the latest git version with it being in a subfolder of the repo?)

While logged in as an admin I expect mini profiler to come up. It doesn’t. It works fine in development. I have not yet tested in production.

Your setup looks fine (FYI I did just push an update to rack mini profiler)

A common reason this happens is resource caching, rails is very aggressive about caching pages using etags and so forth, mini-profiler is aggressive about stopping it.

However if you happen to already have a page cached, mini profiler has no clean way of forcing a local expire.

Anyway.

Can you try:

  1. browsing to your page in incognito mode, do you see mini profiler (if so do a cache dump)
  2. check for that the “__profilin=stylin” cookie is being set, if it is, your auth is all good.
  3. check if you are getting any 404s (using chrome dev tools) to any mp resources. (perhaps they are being blocked)
  4. look at the html of the page, do you see the profiling snippet at the bottom?
  5. try disabling whitelist mode in your environment (on a temp basis) to see if it works: Rack::MiniProfiler.authorization_mode = :allow_all

To run latest git version:

  1. Pull the code
  2. Run bundle in the Ruby dir
  3. Run bundle exec rake build (or bundle exec rake compile_less)
  4. Add gem "rack-mini-profiler", :path => "path\to\mini-profiler\Ruby" to your Gemfile

I can’t really run the latest git version on the server w/ those steps… I don’t think you can combine the path and the git arguments in bundler.

The cookie is set.

I got a 404 to mp’s jquery.

I do see the profile snippet.

So it has something to do w/ that asset?

Sourcing from git direct is going to be tricky, you are going to need to download the code local.

The 404 is likely totally unrelated, are you non nginx or apache? Do you have rules set up to intercept these resources prior to passing them in to rack?

I’ll just point out that not being able to source a gem from git is a pretty nasty problem and makes it significantly harder to contribute and test things.

nginx. Rack serving assets is disabled. Shouldn’t your assets be served via the asset pipeline?

Aaron, at last we are on to the real problem, the railties does not intercept and extend the asset pipeline, hence the problem you are seeing.

I consider that a bug. (and in fact the bug we have here)

As to not being able to source the gem from github, we can rearrange stuff so it can be done.

any way you can paste in your nginx config (at least the non secret parts) so I can repro this.

either that or a steps to repro would be awesome.