Every repository with this icon (
Every repository with this icon (
| Description: | Debugging toolbar for Rack applications implemented as middleware edit |
-
Enabling rack-bug with the bookmarklet returns 500's for any requests made against my app, disabling it returns to normal functionality. Any thoughts?
Console output:
https://gist.github.com/13e071c3827d1c86004eComments
-
Hi,
I can see tha Rack::Bug is using Digest::SHA1 but it's never explicitly required. On some of my apps, it's not required by any other plugin/gem so it's not loaded and I get this :
Status: 500 Internal Server Error
uninitialized constant Digest::SHA1
Comments
I've just added the require in the main lib and it's working :
diff --git a/vendor/plugins/rack-bug/lib/rack/bug.rb b/vendor/plugins/rack-bug/lib/rack/bug.rb index ea36ebe..24128d6 100644 --- a/vendor/plugins/rack-bug/lib/rack/bug.rb +++ b/vendor/plugins/rack-bug/lib/rack/bug.rb @@ -1,4 +1,5 @@ require "rack" +require "digest/sha1" module Rack::Bug require "rack/bug/toolbar" -
rake spec:plugins fail on a new rails application
2 comments Created 7 months ago by unders(in .../vendor/plugins/rack-bug)
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rack/test (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Users/unders/homerails/qwert/vendor/plugins/rack-bug/spec/spec_helper.rb:4Comments
-
Make a gem please... pretty please... with sugar on top (or coke, please underline preferred).
Comments
I second this request - I don't like development stuff be in plugins
There's a gem already: http://gemcutter.org/gems/rack-bug
Add "http://gemcutter.org" to your RubyGems sources! ;)
-
On OS X IPv6 is enabled by default, and local requests are coming from ::1 instead of 127.0.0.1. The following change to options will match both IPv4 and IPv6 localhost:
'rack-bug.ip_masks' => [IPAddr.new("127.0.0.1"), IPAddr.new('::1')],Comments
-
In ruby 1.9 rack-bug raises exception:
/!\ FAILSAFE /!\ 2009-05-31 04:34:24 +0400 Status: 500 Internal Server Error incompatible character encodings: UTF-8 and US-ASCII vendor/plugins/rack-bug/lib/rack/bug/toolbar.rb:136:in `sub!' vendor/plugins/rack-bug/lib/rack/bug/toolbar.rb:136:in `inject_toolbar' vendor/plugins/rack-bug/lib/rack/bug/toolbar.rb:79:in `dispatch' vendor/plugins/rack-bug/lib/rack/bug/toolbar.rb:57:in `call' # debug output: # full_body.encoding == UTF-8 # render.encoding == US-ASCIIPatch: antage@f73f719
Comments
-
I've installed the plugin using the instructions and everything looks ok. I can go to http://localhost:3000/rack_bug/bookmarklet.html and install the bookmarklet fine. When I click on it, it prompts me for the password (I don't have one), and then it says it's enabled. The problem is I never see the toolbar on any of my application's pages. I can see it when I go back to the bookmarklet page, but that is all.
It may be something weird about my config but I don't know where to start looking. Any suggestions?
Comments
If you view source, can you see it in the HTML (at the end of the page)? It may be a CSS conflict of some sort.
handerpeder
Thu Aug 13 14:35:13 -0700 2009
| link
Are you using iframes on your pages. rack-bug inserts its render code just before the first tag found. This means that the rack-bug code gets inserted in the wrong place and doesn't display the toolbar. I've made an easy fix to this which is available in my fork: http://github.com/handerpeder/rack-bug/tree/master
larrywright
Thu Aug 13 15:03:07 -0700 2009
| link
Sorry - missed the first reply here on the 4th. No, I don't see it when I view source at all. I do not use any iframes.
handerpeder
Thu Aug 13 15:32:02 -0700 2009
| link
hmm. are you sure the rack-bug code is being run? try adding a log statement/breakpoint in there and check if it's triggered. If it is then check that
"if toolbar_requested? && ip_authorized? && password_authorized?" is evaluated to true in toolbar.rb.I had to set the ip_masks to the following to make it work:
[IPAddr.new("127.0.0.1"), IPAddr.new("::1")]
sumangurung
Sun Sep 20 08:53:08 -0700 2009
| link
I also couldn't see the toolbar in firefox but i could see the toolbar in opera, weird!!
I also tried setting the ip_masks, but i get 'uninitialized constant IPAddr'. Am i missing some extra configuration??? -
Toolbar not displayed after redirection is intercepted.
1 comment Created 4 months ago by oggySeems like the toolbar should be displayed when a redirection is intercepted. In fact, the specs say it should, but don't actually test that. Fix here:
Comments
-
I just added a small jQuery.noConflict() and it seems to solve some issues :
Index: lib/rack/bug/views/toolbar.html.erb =================================================================== --- lib/rack/bug/views/toolbar.html.erb (revision 1522) +++ lib/rack/bug/views/toolbar.html.erb (working copy) @@ -4,6 +4,9 @@ document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E')); } </script> +<script type="text/javascript"> +jQuery.noConflict(); +</script> <script type="text/javascript" src="/__rack_bug__/jquery.tablesorter.min.js"></script> <script type="text/javascript" src="/__rack_bug__/bug.js"></script> <style type="text/css" media="screen">Comments
-
When testing apps that set cookie options it would be nice to have access to the individual cookies in the jar. I can't see any API to do this.
Rack::Test::CookieJar#[]and#for(uri)return the raw value, not the underlyingRack::Test::Cookie, and#hash_for()is protected. Would it be okay to un-protect#hash_for()or perhaps provide a simpleattr_reader :cookieswithinRack::Test::CookieJarplease?Comments












Thanks for the report.
Try master now and let me know if it's fixed. I added a #to_s which I hope will resolve this.
Pulled down master and saw your change but still receiving a 500.
https://gist.github.com/13e071c3827d1c86004e
Fixed in my fork. Rails does not have Rails::Info in production or whatever. Awaiting brynary merge
Excellent! Thanks for the awesome work guys, it's much appreciated!
Please note that I had to change two lines in lib/rack/bug/panels/sql_panel/query.rb to boot Mongrel with a Rails 2.3.2 app: