Comments (34)
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.
from rack-mini-profiler.
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
when body turns out not to be a String.from rack-mini-profiler.
I think I've tracked my issue down to a log permissions error. I haven't bothered to fix it yet though.
from rack-mini-profiler.
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
from rack-mini-profiler.
I didn't have the oj_mimic_json
gem, but removing heroku-deflator
worked for me.
from rack-mini-profiler.
This still happens for me unless I remove oj_mimic_json
, which I'd like to use.
from rack-mini-profiler.
I have not seen this reported anywhere else.
Are you seeing JS errors in chrome dev tools?
from rack-mini-profiler.
No nothing. I just get an empty div:
Could it be because of the bullet
gem being present?
from rack-mini-profiler.
I removed bullet
, but it didn't change anything.
from rack-mini-profiler.
hmmmm I also lost rack mini profiler (in production only) when I swapped from unicorn to puma. I'm not sure what else I changed, but nothing else comes to mind.
from rack-mini-profiler.
Same here with Rails 4 rails 4.0.0 and ruby 2.0.0p353
As suggested here, doesn't work either http://stackoverflow.com/questions/17025563/how-to-get-mini-profiler-to-start-in-rails
from rack-mini-profiler.
+1
from rack-mini-profiler.
I'm having the same issue. Doesn't work in rails 4 for me
from rack-mini-profiler.
I have the same issue, have tracked it down to having oj_mimic_json in my Gemfile. Anyone else with this issue using the same gem?
from rack-mini-profiler.
@lnovsak same here. oj_mimic_json breaks it.
from rack-mini-profiler.
I have same issue. I have oj_mimic_json in my Gemfile. But then i removed it, problem wasn't resolved.
from rack-mini-profiler.
Same problem here. No error found in Firebug
from rack-mini-profiler.
+1, removing oj_mimic_json and following what is mentioned about Rack::Deflater in the README solved the problem. The request for /rack-mini-profiler/result would hang the ruby process, also see my comment in #112 regarding SystemStackError
from rack-mini-profiler.
+1, removing oj_mimic_json works. I don't get hanging of the ruby process though. Hopefully this can be fixed.
from rack-mini-profiler.
this is all very strange can someone write a test case that fails here, somehow ojs json implementation is lacking and its hurting us here.
from rack-mini-profiler.
The issue is that OJ doesn't handle circular reference in objects. For example:
Never mind, the normal json parser doesn't handle it either.
from rack-mini-profiler.
Oj.default_options = {
:mode => :compat,
:use_to_json => true
}
This works for me for circular references
from rack-mini-profiler.
before any of this can someone help isolate the circular ref, so we can remove it, we don't really need it in our persistence structure.
from rack-mini-profiler.
I also had to both remove Deflator and oj_mimic_json to get this to work. Ruby 2.2, Rails 4.2.1
from rack-mini-profiler.
+1 for removing oj_mimic_json
gem.
from rack-mini-profiler.
Just wanted to chime in that I encountered the same issue. I had to remove the oj_mimic_json
gem for this to work.
The solution that @pencilcheck suggested didn't work for me.
from rack-mini-profiler.
Same issue for me. Described more at #134 (comment)
Btw, I do not use oj_mimic_json
or heroku_deflator
from rack-mini-profiler.
@SamSaffron Here is a fresh Rails app (4.2.6 / 2.3.1) where this has been reproduced. https://github.com/steverob/miniprofiler-production-test
from rack-mini-profiler.
@steverob I ran your test app and was not able to reproduce the problem. The mini profiler showed up just fine on the second request.
from rack-mini-profiler.
Really? :( let me check again.
Regards
Steve Robinson
On 03-Jul-2016, at 11:25 PM, Dave Gynn [email protected] wrote:
@steverob I ran your test app and was not able to reproduce the problem. The mini profiler showed up just fine on the second request.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
from rack-mini-profiler.
@dgynn yes you're right. Upon second request it shows up. No such luck for my app though. Same environment. Any ideas?
from rack-mini-profiler.
@dgynn sorry my bad. I did not restart server after adding the authorize_request
call :(. Code reloading!!
Thanks.
from rack-mini-profiler.
Here is a way to get around minprofile in development mode. If you are using the oj gem and not the oj_mimic_json which really is just a small bit of code.
oj-mimic-json-1.0.1 (lib/oj_mimic_json.rb)
require 'oj'
Oj.mimic_JSON()
# Requiring json here seems to stop conflicts when requiring json in other files.
begin
require 'json'
rescue Exception
# ignore
end
config/initializers/oj.rb
require 'oj'
Oj.default_options = {
mode: :compat
}
# Should be able to remove this(Rails.env.development?) once a update comes out
# https://github.com/MiniProfiler/rack-mini-profiler/pull/250
Oj.mimic_JSON unless Rails.env.development?
Basically I am turning off the OJ system in development as it is the only time we are using to try and backtrace slow queries.
from rack-mini-profiler.
Closing as stale. Linking #16.
from rack-mini-profiler.
Related Issues (20)
- Display EXPLAIN plans
- Rails controller actions should display as ControllerName#action HOT 1
- Choose a code formatter, format the code, and enforce in CI HOT 4
- Validate our responses with Rack::Lint in tests HOT 3
- Fix broken Codecov integration HOT 1
- Infrequent weird output in tests HOT 1
- Intermittent test failure HOT 7
- Clicking "more" in speed badge causes an HTTP request, which doesn't work for HTTPS-only servers
- View previously captured flamegraphs
- Optionally (via config? keyboard shortcut?) show URL or controller action name in the badge itself
- "No snapshots exist" with snapshots enabled
- When `data-vertical-position` is `bottom`, then the popup is not positioned correctly
- always-async-flamegraph mode HOT 1
- Question: Support for tracing forked processes HOT 2
- Display row counts in the UI
- Latest release has an issue ...undefined local variable or method `query_string' HOT 2
- Deprecation warning with Rack >= 3.0.0 - Rack::File is deprecated and will be removed in Rack 3.1
- PRs for dotnet not being handled HOT 1
- "Display name in badge" commit accidentally affects SQL table number alignment
- Compliance with Rack : Spec 3. Lower-case HTTP Headers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rack-mini-profiler.