开发者

Configatron error with the rails3 branch of the apn-on-rails gem

I am receiving this error when I try to deliver pending push notifications (both via the rake task and the object call):

rake aborted!
can't convert Configatron::Store to String (Configatron::Store#to_str gives Configatron::Store)

(See full trace by running task with --trace)

I am using the rails3 branch of apn_on_rails, specified in this SO question, with ruby 1.9.2 and rvm.

Gemfile:

gem 'apn_on_r开发者_如何转开发ails', :git => 'https://github.com/natescherer/apn_on_rails.git', :branch => 'rails3'
gem 'configatron'

and my config\environments\development.rb:

  # development (delivery):
  configatron.apn.passphrase # => '1234'
  configatron.apn.port # => 2195
  configatron.apn.host # => 'gateway.sandbox.push.apple.com'
  configatron.apn.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_development.pem')

Any ideas? (disclaimer: I am somewhat of a rails newbie.)


To assign a value to a configuration parameter you have to use the = operator. For example, configatron.apn.passphrase = '1234'.

In ruby # marks the start of a comment.


I've been look at this issue myself as I'm using apn_on_rails and have noticed that it's recently started breaking with the same error with Configatron.

I noticed that it started happening after I updated my bundle and, specifically, Configatron up to 3.x. I downgraded to 2.13.0 and it now works without an error - I guess apn_on_rails doesn't play nice with Configatron v3.x.

Suggest in your Gemfile:

gem 'configatron', '2.13.0'

and then run

bundle update configatron

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜