ericvg
ericvg

Reputation: 3957

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_rails', :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.)

Upvotes: 0

Views: 1466

Answers (2)

dlinhle
dlinhle

Reputation: 21

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.

Upvotes: 1

matteo
matteo

Reputation: 2256

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.

Upvotes: 1

Related Questions