当我试图传递挂起的推送通知(通过rake任务和对象调用)时,我收到了这个错误:
rake aborted!
can't convert Configatron::Store to String (Configatron::Store#to_str gives Configatron::Store)
(See full trace by running task with --trace)我在Ruby1.9.2和rvm中使用apn_on_rails的rails3分支,在ruby中指定。
Gemfile:
gem 'apn_on_rails', :git => 'https://github.com/natescherer/apn_on_rails.git', :branch => 'rails3'
gem 'configatron'和我的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')有什么想法吗?(声明:我在某种程度上是rails新手。)
发布于 2011-03-30 16:18:13
要为配置参数赋值,必须使用=运算符。例如,configatron.apn.passphrase = '1234‘。
在ruby中#标记注释的开始。
发布于 2014-05-12 10:33:06
当我使用apn_on_rails时,我一直在关注这个问题,并注意到最近Configatron也出现了同样的错误。
我注意到,在我更新了我的捆绑包之后,特别是Configatron升级到3.x之后,它开始发生了。我降级到了2.13.0,现在它可以正常工作了--我猜apn_on_rails在Configatron v3.x上玩得不是很好。
在你的Gemfile中建议:
gem 'configatron', '2.13.0'然后运行
bundle update configatron希望这能有所帮助。
https://stackoverflow.com/questions/5436179
复制相似问题