Rails 3 和苹果推送通知服务
有人能够使用 Rails 3 向 iPhone 发送推送通知吗? 仅限 APN on Rails 和 samesoffes 插件适用于 Rails 2。我是 Rails 新手,我无法使它们中的任何一个工作。
以下是我遇到的错误:
Rails 上的 APN:
尝试替换
ruby script/generate apn_migrations
为
rails generate apn_migrations
got:
myApp/config/environment.rb:5:in `require':没有要加载的文件-- apn_on_rails(加载错误)
我也没有设法运行配置“config.gem 'apn_on_rails'”(config.gem:找不到命令)
Samsoffes 插件:
我没有设法配置 gem:
config.gem "apple_push_notification", :source => "http://gemcutter.org/"
给了我:
http://gemcutter.org/:没有这样的文件或 目录
任何帮助将不胜感激!
谢谢, 文森特
Has anybody been able to send push notification to iPhone using rails 3 ?
APN on rails and samesoffes plugin only works with rails 2. I am new to rails and i have not been able to make either of them work.
Here are the errors i encountered :
APN on Rails :
tried to replace
ruby script/generate apn_migrations
With
rails generate apn_migrations
got :
myApp/config/environment.rb:5:in
`require': no such file to load --
apn_on_rails (LoadError)
I also did not manage to run the configuration "config.gem 'apn_on_rails'" (config.gem: command not found)
Samsoffes plugin :
I did not manage to config the gem :
config.gem "apple_push_notification", :source => "http://gemcutter.org/"
gave me :
http://gemcutter.org/: No such file or
directory
Any help would be greatly appreciated !
Thanks,
Vincent
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,我使用了rails3分支
gem 'apn_on_rails', :git => 'https://github.com/natescherer/apn_on_rails.git', :branch => 'rails3'
这解决了我的问题,我将详细信息写入我的博客
http:// /yekmer.posterous.com/how-to-send-iphone-push-notifications-in-rail
I had the same problem, I had used a rails3 branch
gem 'apn_on_rails', :git => 'https://github.com/natescherer/apn_on_rails.git', :branch => 'rails3'
This solved my problem and I wrote the details to my blog
http://yekmer.posterous.com/how-to-send-iphone-push-notifications-in-rail
我专门针对 Rails 3 编写了一个名为 Rpush 的 apn_on_rails 替代品。我还添加了一些额外的功能,例如与 APN 的持久连接(按照 Apple 的建议)。频繁的连接/断开可能会导致您被禁止使用 APN,这就是 apn_on_rails 目前的工作原理。
RPUSH: https://github.com/rpush/rpush
I've written an apn_on_rails replacement called Rpush specifically targeted at Rails 3. I've also added a bunch of extra features like persistent connections to the APNs (as recommended by Apple). Frequent connects/disconnects may get you banned from the APNs, which is how apn_on_rails currently works.
Rpush: https://github.com/rpush/rpush
在 Rails 3 中,没有 config.gem...打开您的
Gemfile
:In rails 3, there is no config.gem... Open up your
Gemfile
: