Skip to content

Instantly share code, notes, and snippets.

@strongjz
Created March 10, 2015 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strongjz/042516b1844c8abea147 to your computer and use it in GitHub Desktop.
Save strongjz/042516b1844c8abea147 to your computer and use it in GitHub Desktop.
load errors with ruby, bunny and honeybadger class
irb(main):001:0> require 'bunny'
=> true
irb(main):002:0> c = Bunny.new
=> #<Bunny::Session:0x007f7074461e00 @default_hosts_shuffle_strategy=#<Proc:0x007f7074461ce8@/usr/local/lib/ruby/gems/2.0.0/gems/bunny-1.7.0/lib/bunny/session.rb:137>, @opts={}, @hosts=["127.0.0.1"], @host_index=1, @port=5672, @user="guest", @pass="guest", @vhost="/", @logfile=#<IO:<STDOUT>>, @threaded=true, @logger=#<Logger:0x007f7074461b30 @progname="#<Bunny::Session:70060481908480 guest@127.0.0.1:5672, vhost=/, hosts=[127.0.0.1]>", @level=2, @default_formatter=#<Logger::Formatter:0x007f7074461a90 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x007f7074461a18 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x007f70744619f0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f7074461978>>>>, @automatically_recover=true, @network_recovery_interval=5.0, @recover_from_connection_close=false, @continuation_timeout=4000, @status=:not_connected, @blocked=false, @client_frame_max=131072, @client_channel_max=65535, @channel_max=65535, @client_heartbeat=:server, @client_properties={:capabilities=>{:publisher_confirms=>true, :consumer_cancel_notify=>true, :exchange_exchange_bindings=>true, :"basic.nack"=>true, :"connection.blocked"=>true, :authentication_failure_close=>true}, :product=>"Bunny", :platform=>"ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-linux]", :version=>"1.7.0", :information=>"http://rubybunny.info"}, @mechanism="PLAIN", @credentials_encoder=#<Bunny::Authentication::PlainMechanismEncoder:0x007f7074461658 @session=#<Bunny::Session:0x007f7074461e00 ...>>, @locale="en_GB", @mutex_impl=Monitor, @channel_mutex=#<Monitor:0x007f7074461590 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f7074461518>>, @transport_mutex=#<Monitor:0x007f70744614c8 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f7074461478>>, @status_mutex=#<Monitor:0x007f7074461428 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f7074461360>>, @host_index_mutex=#<Monitor:0x007f7074461310 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f70744612c0>>, @channels={}, @origin_thread=#<Thread:0x007f707446fcf8 run>, @continuations=#<Bunny::Concurrent::ContinuationQueue:0x007f7074461248 @q=#<Queue:0x007f70744611d0 @que=[], @num_waiting=0, @mutex=#<Mutex:0x007f7074461108>, @cond=#<ConditionVariable:0x007f7074461068 @waiters={}, @waiters_mutex=#<Mutex:0x007f7074460fc8>>>>, @transport=#<Bunny::Transport:0x007f7074460dc0 @session=#<Bunny::Session:0x007f7074461e00 ...>, @session_thread=#<Thread:0x007f707446fcf8 run>, @host="127.0.0.1", @port=5672, @opts={:session_thread=>#<Thread:0x007f707446fcf8 run>}, @logger=#<Logger:0x007f7074461b30 @progname="#<Bunny::Session:70060481908480 guest@127.0.0.1:5672, vhost=/, hosts=[127.0.0.1]>", @level=2, @default_formatter=#<Logger::Formatter:0x007f7074461a90 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x007f7074461a18 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x007f70744619f0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f7074461978>>>>, @tls_enabled=false, @read_timeout=5.0, @write_timeout=5.0, @connect_timeout=25.0, @disconnect_timeout=5.0, @writes_mutex=#<Monitor:0x007f7074460d98 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f7074460cf8>>>>
irb(main):003:0> c.class.name.demodulize
NoMethodError: undefined method `demodulize' for "Bunny::Session":String
from (irb):3
from /usr/local/bin/irb:12:in `<main>'
irb(main):004:0> c.class.name
=> "Bunny::Session"
irb(main):005:0> require '/apps/hbc-class/honeybadger'
/apps/hbc-class/honeybadger.rb:8: warning: class variable access from toplevel
/apps/hbc-class/honeybadger.rb:9: warning: class variable access from toplevel
/apps/hbc-class/honeybadger.rb:9: warning: class variable access from toplevel
/apps/hbc-class/honeybadger.rb:10: warning: class variable access from toplevel
/apps/hbc-class/honeybadger.rb:10: warning: class variable access from toplevel
/apps/hbc-class/honeybadger.rb:11: warning: class variable access from toplevel
/apps/hbc-class/honeybadger.rb:11: warning: class variable access from toplevel
=> true
irb(main):006:0> c = Bunny::Session.new
NoMethodError: undefined method `new' for nil:NilClass
from /usr/local/lib/ruby/gems/2.0.0/gems/bunny-1.7.0/lib/bunny/authentication/credentials_encoder.rb:24:in `for_session'
from /usr/local/lib/ruby/gems/2.0.0/gems/bunny-1.7.0/lib/bunny/session.rb:1135:in `credentials_encoder_for'
from /usr/local/lib/ruby/gems/2.0.0/gems/bunny-1.7.0/lib/bunny/session.rb:175:in `initialize'
from (irb):6:in `new'
from (irb):6
from /usr/local/bin/irb:12:in `<main>'
irb(main):007:0> c.class
=> Bunny::Session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment