1

我在使分段环境中的Rapns工作时遇到问题。在我的本地开发运行时 一切运作良好,但在时分期(使用AWS)我无法启动守护程序或致电Rapns.push无法在分段环境中使用Rapns(ArgumentError:Fixnum与阵列的比较失败)

当调用bundle exec rapns staging我没有错误,但未能发送通知。

当使用bundle exec rapns staging -f或试图调用Rapns.push从铁轨控制台时,我得到:

[2013-05-29 06:54:20] [ios] Started, 1 handler. 
[2013-05-29 06:54:20] [ERROR] [ios] Exception raised during startup. Notifications will  not be delivered for this app. 
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/logger.rb:365:in `<': comparison of  Fixnum with Array failed (ArgumentError) 
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/logger.rb:365:in `add' 
    from .../shared/bundle/ruby/1.9.1/gems/activesupport-3.2.7/lib/active_support/buffered_logger.rb:80:in `add' 
    from .../shared/bundle/ruby/1.9.1/gems/activesupport-3.2.7/lib/active_support/buffered_logger.rb:90:in `error' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/logger.rb:53:in `log' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/logger.rb:28:in `error' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/daemon/app_runner.rb:34:in `rescue in sync_app' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/daemon/app_runner.rb:30:in `sync_app' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/daemon/app_runner.rb:20:in `block in sync' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/daemon/app_runner.rb:20:in `each' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/daemon/app_runner.rb:20:in `sync' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/lib/rapns/daemon.rb:47:in `start' 
    from .../shared/bundle/ruby/1.9.1/gems/rapns-3.3.0/bin/rapns:36:in `<top (required)>' 
    from .../shared/bundle/ruby/1.9.1/bin/rapns:23:in `load' 
    from .../shared/bundle/ruby/1.9.1/bin/rapns:23:in `<main>' 

再次,一切正常我的本地机器上。有任何想法吗?非常感谢!

回答

1

这可能是因为您使用橡胶部署到AWS,并且它默认配置了其他记录器(graylog)。

要解决这个问题,编辑rapns初始化文件(配置/初始化/ rapns.rb),并设置记录器为默认轨道记录器(或您自己):

config.logger = Rails.logger#这是记录器由graylog设置

希望这可以帮助!

+0

谢谢@kevin Liang! – ringular