我正在尝试创建一个从我的google云端硬盘中的电子表格中读取的网络应用。但当我完成Oauth2程序并想要列出文件时,我得到了这个错误:
NoMethodError: undefined method `drive' for nil:NilClass
from /Users/administrator/.rvm/gems/ruby-2.2.0/gems/google_drive-1.0.0/lib/google_drive/session.rb:101:in `drive'
from /Users/administrator/.rvm/gems/ruby-2.2.0/gems/google_drive-1.0.0/lib/google_drive/session.rb:149:in `file_by_id'
from /Users/administrator/.rvm/gems/ruby-2.2.0/gems/google_drive-1.0.0/lib/google_drive/session.rb:186:in `spreadsheet_by_key'
from (irb):21
from /Users/administrator/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main>'
我使用Rails 4.2.0和ruby 2.2.0