installing bullet

Published on:

refer to:
https://github.com/flyerhzm/bullet

  1. install gem bullet and development env
    gem 'bullet', group: 'development'
    
    $ bundle install $ rails s
config.after_initialize do
  Bullet.enable = true
  Bullet.alert = true
  Bullet.bullet_logger = true
  Bullet.console = true
  Bullet.growl = true
  Bullet.xmpp = { :account  => 'bullets_account@jabber.org',
                  :password => 'bullets_password_for_jabber',
                  :receiver => 'your_account@jabber.org',
                  :show_online_status => true }
  Bullet.rails_logger = true
  Bullet.honeybadger = true
  Bullet.bugsnag = true
  Bullet.airbrake = true
  Bullet.rollbar = true
  Bullet.add_footer = true
  Bullet.stacktrace_includes = [ 'your_gem', 'your_middleware' ]
  Bullet.stacktrace_excludes = [ 'their_gem', 'their_middleware' ]
  Bullet.slack = { webhook_url: 'http://some.slack.url', channel: '#default', username: 'notifier' }
end
  1. error 1
    rails s log:

    /Users/Yammy/.rvm/gems/ruby-2.3.1/gems/uniform_notifier-1.10.0/lib/uniform_notifier/growl.rb:16:in `rescue in rescue in setup_connection': You must install the ruby-growl or the ruby_gntp gem to use Growl notification: `gem install ruby-growl` or `gem install ruby_gntp` (UniformNotifier::NotificationError)
    
  2. install ruby-growl & ruby_gntp

    gem 'ruby-growl'
    gem 'ruby_gntp'
    

    $ bundle install
    $ rails s

  3. error 2

    /Users/Yammy/.rvm/gems/ruby-2.3.1/gems/ruby-growl-4.1/lib/ruby-growl/udp.rb:166:in `send': Connection refused - send(2) (Errno::ECONNREFUSED)
    
  4. reread readme
    I notice this:

    The code above will enable all of the Bullet notification systems:
    
    
    

    Bullet.enable: enable Bullet gem, otherwise do nothing
    Bullet.alert: pop up a JavaScript alert in the browser
    Bullet.bullet_logger: log to the Bullet log file (Rails.root/log/bullet.log)
    Bullet.console: log warnings to your browser's console.log (Safari/Webkit browsers or Firefox w/Firebug installed)
    Bullet.growl: pop up Growl warnings if your system has Growl installed. Requires a little bit of configuration
    Bullet.xmpp: send XMPP/Jabber notifications to the receiver indicated. Note that the code will currently not handle the adding of contacts, so you will need to make both accounts indicated know each other manually before you will receive any notifications. If you restart the development server frequently, the 'coming online' sound for the Bullet account may start to annoy - in this case set :show_online_status to false; you will still get notifications, but the Bullet account won't announce it's online status anymore.
    Bullet.rails_logger: add warnings directly to the Rails log
    Bullet.honeybadger: add notifications to Honeybadger
    Bullet.bugsnag: add notifications to bugsnag
    Bullet.airbrake: add notifications to airbrake
    Bullet.rollbar: add notifications to rollbar
    Bullet.add_footer: adds the details in the bottom left corner of the page. Double click the footer or use close button to hide footer.
    Bullet.stacktrace_includes: include paths with any of these substrings in the stack trace, even if they are not in your main app
    Bullet.stacktrace_excludes: ignore paths with any of these substrings in the stack trace, even if they are not in your main app.
    Bullet.slack: add notifications to slack
    Bullet.raise: raise errors, useful for making your specs fail unless they have optimized queries


    ok, I finally got it .
    so I can use some of them.

    1. revise
      config.after_initialize do
       Bullet.enable = true
       Bullet.alert = true
       Bullet.bullet_logger = true
       Bullet.console = true
       Bullet.rails_logger = true
       Bullet.airbrake = true
       Bullet.add_footer = true
      end
      
    2. server error rails s error:
      /Users/Yammy/.rvm/gems/ruby-2.3.1/gems/puma-3.7.0/lib/puma/binder.rb:269:in `initialize': Address already in use - bind(2) for "0.0.0.0" port 3000 (Errno::EADDRINUSE)
      

    solve:
    $ lsof -wni tcp:3000


    $ kill -9 38424

    1. restart server Nothing happened.

Comments

comments powered by Disqus