[英]How do I solve NoMethodError with google_drive gem?
我试图创建一个从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>'
我在Ruby 2.2.0中使用Rails 4.2.0
client_or_access_token
参数为nil
。 看这段代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.