开发者

rexml NoMethodError- 'elements' for nil:NilClass

I am using gdata ruby gem for Google APIs to get Calendars. (as per http://code.google.com/apis/gdata/articles/gdata_on_rails.html#ClientLogin)

Problem is that even if the calendar feed has valid XML, I keep on getting : NoMethodError (undefined method 'elements' for nil:NilClass): app/controllers/g_data_controller.rb:74:in block in fetch_feed' app/controllers/g_data_controller.rb:63:infetch_开发者_运维技巧feed' app/controllers/g_data_controller.rb:122:in `index'

feed= @client.get(m.gcal_id).to_xml
if feed
   entry=feed.elements['entry']    #Error on this line !

Not sure what is the matter with this code BTW, I am using rexml (as suggested by google) to parse the XMl elements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜