Google analytics 解析来自Garb的响应时遇到问题

Google analytics 解析来自Garb的响应时遇到问题,google-analytics,ruby-on-rails-3.2,google-analytics-api,garb-gem,Google Analytics,Ruby On Rails 3.2,Google Analytics Api,Garb Gem,我正在尝试在我的rails应用程序中使用Sija。但是我在获得配置文件后解析响应时遇到了问题。以下是我为获取配置文件所做工作的摘要: Garb::Session.access_token = token subs = Garb::Management::Profile.all @subsInfo = [] subs.each do |sub| sub_info = {:sid => sub.id, :sname => sub.name,

我正在尝试在我的rails应用程序中使用Sija。但是我在获得配置文件后解析响应时遇到了问题。以下是我为获取配置文件所做工作的摘要:

Garb::Session.access_token = token
subs = Garb::Management::Profile.all
@subsInfo = []
subs.each do |sub|
  sub_info = {:sid => sub.id,
              :sname => sub.name, 
              :surl => sub.websiteUrl
             }
  @subsInfo << sub_info
end
我一辈子都搞不懂为什么网站URL告诉我它是未定义的。不仅是这个属性,还有其他几个属性,但由于某些原因,id和名称工作得很好。

找到了答案。该属性已从websiteUrl重命名为websiteUrl。哎呀

---
- !ruby/object:Garb::Management::Profile
  entry:
    id: '12345678'
    kind: analytics#profile
    selfLink: https://www.googleapis.com/analytics/v3/management/accounts/01234567/webproperties/UA-01234567-1/profiles/12345678
    accountId: '01234567'
    webPropertyId: UA-01234567-1
    internalWebPropertyId: '12345678'
    name: first property
    currency: USD
    timezone: America/New_York
    websiteUrl: http://www.firstproperty.com
    defaultPage: http://www.firstproperty.com/home.html
    type: WEB
    created: '2010-05-21T14:40:46.600Z'
    updated: '2011-02-02T16:51:12.910Z'
    eCommerceTracking: true
    parentLink:
      type: analytics#webproperty
      href: https://www.googleapis.com/analytics/v3/management/accounts/01234567/webproperties/UA-12345678-1
    childLink:
      type: analytics#goals
      href: https://www.googleapis.com/analytics/v3/management/accounts/01234567/webproperties/UA-01234567-1/profiles/12345678/goals
  session: &12345678901234 !ruby/class 'Garb::Session'
- !ruby/object:Garb::Management::Profile
  entry:
    id: '23456789'
    kind: analytics#profile
    selfLink: https://www.googleapis.com/analytics/v3/management/accounts/01234567/webproperties/UA-01234567-2/profiles/23456789
    accountId: '01234567'
    webPropertyId: UA-01234567-2
    internalWebPropertyId: '23456789'
    name: Second Property
    currency: USD
    timezone: America/Los_Angeles
    websiteUrl: http://www.secondproperty.com/
    defaultPage: http://www.secondproperty.com/index.html
    type: WEB
    created: '2010-07-05T19:58:33.611Z'
    updated: '2011-02-02T16:51:12.922Z'
    eCommerceTracking: true
    parentLink:
      type: analytics#webproperty
      href: https://www.googleapis.com/analytics/v3/management/accounts/01234567/webproperties/UA-01234567-2
    childLink:
      type: analytics#goals
      href: https://www.googleapis.com/analytics/v3/management/accounts/01234567/webproperties/UA-01234567-2/profiles/23456789/goals
  session: *012345678901234