1
我正在使用quimby gem來與foursquare的場地API進行接口。我有一個建立模型,我試圖運行一個在foursquare上查找建立的方法,這樣我就可以用4sq提供的數據做一些事情。foursquare API調用在quintby gem的heroku控制檯中失敗
在我的模型建立當我執行這個從本地主機控制檯一切順利,我創造了這個方法
def find_on_foursquare
Foursquare.verbose = true
foursquare = Foursquare::Base.new(FOURSQUARE_ID, FOURSQUARE_SECRET)
begin
venue = foursquare.venues.search(:ll => "#{self.lat},#{self.long}",
:query => self.name,
:categoryId => '4d4b7105d754a06374d81259')['nearby'][0]
puts venue
rescue
puts 'FAILED!'
end
end
。然而,當我推到heroku,並嘗試從heroku控制檯執行它失敗,「!內部服務器錯誤」
任何想法我做錯了什麼和/或如何調試呢?
有些好奇線從Heroku的日誌:
2011-12-29T17:09:29+00:00 app[web.1]: [foursquare] GET https://api.foursquare.com/v2/venues/search
2011-12-29T17:09:29+00:00 app[web.1]: [foursquare] PARAMS: {"ll"=>"42.344432,-71.098326", "query"=>"Citizen", "categoryId"=>"4d4b7105d754a06374d81259"}
2011-12-29T17:09:29+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/typhoeus-0.3.3/lib/typhoeus/easy.rb:397: [BUG] Segmentation fault
2011-12-29T17:09:29+00:00 app[web.1]: ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
不知道爲什麼heroku不高興,但一定要在您的請求中指定一個版本! https://developer.foursquare.com/overview/versioning – akdotcom 2011-12-29 21:18:09