Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized constant Rpush::Daemon #29

Closed
jayztemplier opened this issue Mar 25, 2014 · 1 comment
Closed

Uninitialized constant Rpush::Daemon #29

jayztemplier opened this issue Mar 25, 2014 · 1 comment

Comments

@jayztemplier
Copy link

Hi :)

I'm currently configuring the rpush gem to be able to report some data to New Relic, and for that I would like to use this callback in the rpush.rb file:

  Rpush::Daemon::AppRunner.runners.each do |app_id, runner|
     runner.app
     runner.queue_size

     ::NewRelic::Agent.record_metric("Custom/Push/APNS/queue/#{runner.app.name}/queue", runner.queue_size)
  end

Unfortunately, it triggers this error when running:
rpush development -f

/Users/Jeremy/Documents/rails/MobilePushNotificationService/MobilePushNotificationService/config/initializers/rpush.rb:42:in `block in <top (required)>': uninitialized constant Rpush::Daemon (NameError)
    from /Users/Jeremy/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rpush-1.0.0/lib/rpush/reflection.rb:3:in `reflect'

Any idea how to fix it ?

Thank you in advance for your help!
Jeremy.

@ileitch
Copy link
Member

ileitch commented Mar 30, 2014

You need to require the 'daemon' files: Rpush.require_for_daemon

@ileitch ileitch closed this as completed Mar 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants