Code Monkey home page Code Monkey logo

Comments (34)

nruth avatar nruth commented on July 24, 2024 3

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.

thatpixguy avatar thatpixguy commented on July 24, 2024 2

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.

brandonparsons avatar brandonparsons commented on July 24, 2024 1

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.

hakunin avatar hakunin commented on July 24, 2024 1

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.

jhubert avatar jhubert commented on July 24, 2024 1

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

from rack-mini-profiler.

Ch4s3 avatar Ch4s3 commented on July 24, 2024 1

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

from rack-mini-profiler.

SamSaffron avatar SamSaffron commented on July 24, 2024

I have not seen this reported anywhere else.

Are you seeing JS errors in chrome dev tools?

from rack-mini-profiler.

abuisman avatar abuisman commented on July 24, 2024

No nothing. I just get an empty div:

screen shot 2014-03-26 at 15 32 11

Could it be because of the bullet gem being present?

from rack-mini-profiler.

abuisman avatar abuisman commented on July 24, 2024

I removed bullet, but it didn't change anything.

from rack-mini-profiler.

brandonparsons avatar brandonparsons commented on July 24, 2024

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.

 avatar commented on July 24, 2024

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.

JoshTGreenwood avatar JoshTGreenwood commented on July 24, 2024

+1

from rack-mini-profiler.

adiakritos avatar adiakritos commented on July 24, 2024

I'm having the same issue. Doesn't work in rails 4 for me

from rack-mini-profiler.

luka-n avatar luka-n commented on July 24, 2024

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.

hunterboerner avatar hunterboerner commented on July 24, 2024

@lnovsak same here. oj_mimic_json breaks it.

from rack-mini-profiler.

krim avatar krim commented on July 24, 2024

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.

arthurtalkgoal avatar arthurtalkgoal commented on July 24, 2024

Same problem here. No error found in Firebug

from rack-mini-profiler.

akshetpandey avatar akshetpandey commented on July 24, 2024

+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.

pencilcheck avatar pencilcheck commented on July 24, 2024

+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.

SamSaffron avatar SamSaffron commented on July 24, 2024

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.

akshetpandey avatar akshetpandey commented on July 24, 2024

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.

pencilcheck avatar pencilcheck commented on July 24, 2024

Oj.default_options = {
:mode => :compat,
:use_to_json => true
}

This works for me for circular references

from rack-mini-profiler.

SamSaffron avatar SamSaffron commented on July 24, 2024

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.

DavidRagone avatar DavidRagone commented on July 24, 2024

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.

eggie5 avatar eggie5 commented on July 24, 2024

+1 for removing oj_mimic_json gem.

from rack-mini-profiler.

kevinjalbert avatar kevinjalbert commented on July 24, 2024

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.

steverob avatar steverob commented on July 24, 2024

Same issue for me. Described more at #134 (comment)

Btw, I do not use oj_mimic_json or heroku_deflator

from rack-mini-profiler.

steverob avatar steverob commented on July 24, 2024

@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.

dgynn avatar dgynn commented on July 24, 2024

@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.

steverob avatar steverob commented on July 24, 2024

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.

steverob avatar steverob commented on July 24, 2024

@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.

steverob avatar steverob commented on July 24, 2024

@dgynn sorry my bad. I did not restart server after adding the authorize_request call :(. Code reloading!!

Thanks.

from rack-mini-profiler.

brand-it avatar brand-it commented on July 24, 2024

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.

nateberkopec avatar nateberkopec commented on July 24, 2024

Closing as stale. Linking #16.

from rack-mini-profiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.