Http在heroku的rake任务中被忽略了

时间:2016-06-14 07:52:23

标签: ruby-on-rails ruby heroku

我有以下http get任务:

 stubhubapi1 = HTTParty.get(URI.encode('https://api.stubhub.com/search/catalog/events/v3/?parking=false&status=active&fieldList=id,name,description,eventUrl,eventDateLocal,ticketInfo,imageUrl&sort=popularity&desc&allowedViewingDomain=stubhub.co.uk&q=' + tmname + '&date=' + tmdate + ' TO ' + apidate + ''), headers: {"Authorization" => "Bearer bunchoflettershere"}).parsed_response
  if stubhubapi1.present?
    if stubhubapi1['numFound'].present?
    if stubhubapi1['numFound'] > 0
      stubhubid = stubhubapi1['events'].first['id']
    end
    end
  end

现在tmname tmdate和apidate等所有内容都按预期工作。它甚至在本地工作。但是,如果我在网上运行rake任务,它就无法正常工作。 (我知道这一点,因为我可以检查数据库,而不是填充列)

任何想法为什么?

0 个答案:

没有答案