【问题标题】:Ruby google_drive gem ProblemsRuby google_drive gem 问题
【发布时间】:2014-05-22 18:12:19
【问题描述】:

https://github.com/gimite/google-drive-ruby

谷歌文档似乎有更新。现在在新的谷歌文档中有一个“插件”功能。有人找到了新版本的 google docs 和 google_drive gem 的解决方法吗?

require 'google_drive'

session = GoogleDrive.login("username@gmail.com", "password")

# the key is found in the url of a google doc web address
# https://docs.google.com/a/pz7XtlQC-PYx-jrVMJErTcg#gid=0    

ws = session.spreadsheet_by_key("pz7XtlQC-PYx-jrVMJErTcg").worksheets[0]


ws.rows
=> ERRORS
ws[1,1]
=> "test" 

ws[1,1] = "hi"
ws.save()
=> ERRORS 

有人有解决方法吗?

【问题讨论】:

  • 新的谷歌文档屏幕右下角有一个绿色的小按钮。点击该按钮并“恢复到旧的谷歌电子表格”

标签: ruby google-drive-api


【解决方案1】:

0.3.8 版本开始,gem 支持新的电子表格。 另外,您可以尝试 spreadsheer_by_url 方法。 例如:

require 'google_drive'

session = GoogleDrive.login("username@gmail.com", "password")

ws = session.spreadsheet_by_url('https://docs.google.com/a/pz7XtlQC-PYx-jrVMJErTcg#gid=0').worksheets[0]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-11-11
    • 1970-01-01
    • 2012-07-08
    • 1970-01-01
    • 1970-01-01
    • 2017-01-11
    • 2011-08-02
    相关资源
    最近更新 更多