nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

Houston::Client.production.devices raises exception #91

Closed davidpdrsn closed 9 years ago

davidpdrsn commented 9 years ago

I get the following error when I call Houston::Client.production.devices from the rails console.

[2] pry(main)> Houston::Client.production.devices
TypeError: no implicit conversion of nil into String
from /app/vendor/bundle/ruby/2.2.0/gems/houston-2.2.3/lib/houston/connection.rb:39:in `initialize'
kaneda commented 9 years ago

Hey @davidpdrsn, it looks like you're trying to do this without first defining the passphrase or certificate.

If you were to create an APN in the environment file itself, for instance, and then invoke it, e.g.

# In your config
config.your_apn = Houston::Client.production
config.apn.certificate = File.read("/path/to/your/pem")
config.apn.passphrase = "yoursecretpassphrase"

# In the rails console for that environment
YourApp::Application.config.your_apn.devices

you would see that it works.

davidpdrsn commented 9 years ago

That fixed it! Thanks :smile: