I\'ve been fighting this problem all day, and could really need some input.
I have a Rails application (3.1.3) running on Heroku Cedar, trying to publish some Facebook O
Solved it!
Really stupid actually. I had only one web dyno in my Heroku application. Since my only web dyno was doing the Facebook API call, there was no dyno to respond to the Facebook callback. You need at least 2 to get this to work.
The reason the code worked in heroku console was simply because the web dyno was not busy handling my request.
I might push that code to a work queue in the future as it seems more appropriate and let a worker dyno handle the Facebook publishing.
An alternative to a second dyno might be to try Unicorn - that would allow your app to service the second call while the first is blocked.
These articles give some useful detail on getting started with Unicorn:
The following link seems to suggest this is timeout related, although no actual solution has yet been given. facebook "could not retrieve data from URL"
You may want to also keep track of answers for the above link.