使用 Koala 实时更新 Heroku 上的内部服务器错误
我正在尝试使用 Heroku 上部署的 Koala gem 生成实时更新订阅。但是,当我运行以下命令时:
@updates = Koala::Facebook::RealtimeUpdates.new(:app_id => APP_ID, :secret => APP_SECRET) @updates.subscribe("用户", "提要", CALLBACK_URL, VERIFY_TOKEN)
在heroku控制台,我得到:
! Internal server error
但是,当我检查我的Heroku日志时,我没有看到500错误。事实上,一切看起来都很顺利:
heroku[路由器]:获取blah-blah-760.heroku.com/facebook_updates/dyno=web.1队列=0等待=0ms服务=5951ms状态=200字节=10
heroku[nginx]: 66.220.149.250 - - [05/Oct/2011:11:55:11 -0700] “GET /facebook_updates/?hub.mode=subscribe&hub.challenge =1234567890&hub.verify_token=XXXXXXX HTTP/1.0" 200 10 “-”“facebookplatform/1.0 (+http://developers.facebook.com)”blah-blah-760.heroku.com
当我将 GET 请求粘贴到浏览器中时,它会回显hub.challenge 参数正确。
我的控制器如下:
class FacebookUpdatesController < ApplicationController
layout nil
def index #this method responds to the Facebook GET
logger.info "about to meet challenge"
render :text => Koala::Facebook::RealtimeUpdates.meet_challenge(params, VERIFY_TOKEN)
end
def create #this method responds to POST messages
logger.info params
end
end
我的路线配置如下:
resources :facebook_updates, :only => [:create, :index]
我觉得我真的很接近。任何帮助将不胜感激。
I'm trying to generate a realtime updates subscription using the Koala gem deployed on Heroku. However, when I run the following:
@updates = Koala::Facebook::RealtimeUpdates.new(:app_id => APP_ID, :secret => APP_SECRET)
@updates.subscribe("user", "feed", CALLBACK_URL, VERIFY_TOKEN)
at the heroku console, I get:
! Internal server error
However, when I check my Heroku logs, I don't see a 500 error. In fact, everything seems hunky-dori:
heroku[router]: GET blah-blah-760.heroku.com/facebook_updates/ dyno=web.1 queue=0 wait=0ms service=5951ms status=200 bytes=10
heroku[nginx]: 66.220.149.250 - - [05/Oct/2011:11:55:11 -0700] "GET /facebook_updates/?hub.mode=subscribe&hub.challenge=1234567890&hub.verify_token=XXXXXXX HTTP/1.0" 200 10 "-" "facebookplatform/1.0 (+http://developers.facebook.com)" blah-blah-760.heroku.com
When I paste the GET request into the browser, it echoes the hub.challenge parameter correctly.
My controller is as follows:
class FacebookUpdatesController < ApplicationController
layout nil
def index #this method responds to the Facebook GET
logger.info "about to meet challenge"
render :text => Koala::Facebook::RealtimeUpdates.meet_challenge(params, VERIFY_TOKEN)
end
def create #this method responds to POST messages
logger.info params
end
end
My routes are configured as follows:
resources :facebook_updates, :only => [:create, :index]
I feel like I'm really close. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它无法同时处理这两个请求,如果您在本地控制台运行
@updates.subscribe("user", "feed", CALLBACK_URL, VERIFY_TOKEN)
它将起作用。It can't handle the both requests at the same time, if you run the
@updates.subscribe("user", "feed", CALLBACK_URL, VERIFY_TOKEN)
at a local console it will work.