在heroku上使用rapns进行推送通知 [英] Using rapns on heroku for push notification
问题描述
我在我的Rails应用上使用了gem rapns(https://github.com/ileitch/rapns)。根据rapns文档,我需要运行
bundle exec rapns $ b
/ b>
启动守护进程,该进程会检查数据库以发送新通知。
<所以我做了以下事情:
heroku run bundle exec rapns production --foreground
给了我一个错误:
运行bundle exec rapns production --foreground attached to terminal ... up,run.3
[WARNING]检测到Rails 3.1.1,修补PostgreSQLAdapter以修复重新连接错误:https://github.com/rails/rails/issues/3160
/ app /.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:95:in initialize':No such file or directory - /app/tmp/pids/rapns.pid (Errno :: ENOENT)
from /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:95:inopen'
from /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:95:in wr ite_pid_file'从/app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:43:instart'
from / app /。 bundle / gems / ruby / 1.9.1 / gems / rapns-1.0.1 / bin / rapns:28:在< top(required)>'
from /app/.bundle/gems/ruby/1.9 .1 / bin / rapns:19:从/app/.bundle/gems/ruby/1.9.1/bin/rapns:19:in inload'
'in $'
我对rails和ruby非常新颖,有人能告诉我发生了什么问题吗?
I'm using gem rapns (https://github.com/ileitch/rapns) on my rails app.
According to rapns doc, I need to run
bundle exec rapns
to kick start the daemon process which checks database for new notifications to send.
So I did following:
heroku run bundle exec rapns production --foreground
which gave me error:
Running bundle exec rapns production --foreground attached to terminal... up, run.3 [WARNING] Detected Rails 3.1.1, patching PostgreSQLAdapter to fix reconnection bug: https://github.com/rails/rails/issues/3160 /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:95:in initialize': No such file or directory - /app/tmp/pids/rapns.pid (Errno::ENOENT) from /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:95:inopen' from /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:95:in write_pid_file' from /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/lib/rapns/daemon.rb:43:instart' from /app/.bundle/gems/ruby/1.9.1/gems/rapns-1.0.1/bin/rapns:28:in <top (required)>' from /app/.bundle/gems/ruby/1.9.1/bin/rapns:19:inload' from /app/.bundle/gems/ruby/1.9.1/bin/rapns:19:in `'
I'm very very new to rails and ruby, can someone tell me what's going wrong?
解决方案You need to remove the pid_file option from the production configuration and/or upgrade to 1.0.2, which is tolerant of a non-writable pid_file option.
这篇关于在heroku上使用rapns进行推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文