虽然我理解这个错误意味着什么,但我似乎没有做任何可能导致错误的错误。我们假设我有2个文件:
auths_controller.rb:
def index
config = GmailOauth::Application.credentials.google[:web].stringify_keys!
gmail_client = Gmail::GmailClient.new(config)
end
config只是一个带符号的哈希类,在这个例子中我甚至将键字串化,所以我可以访问它们:config [" client_id"]
这里"输出"输出配置"在这个文件中:
{" client_id" =>" xxx.apps.googleusercontent.com"," project_id" =>" xxx", " auth_uri" =>" https://accounts.google.com/o/oauth2/auth"," token_uri" =>" https://accounts.google.com/o/oauth2/token", " auth_provider_x509_cert_url" =>" https://www.googleapis.com/oauth2/v1/certs"," client_secret" =>" xxx"}
一切都好,对吗?这是GmailClient文件:
module Gmail
class GmailClient
def initialize(config)
puts config # this already throws the error!
exit
我不明白为什么只是传递方法调用我得到了错误"没有将符号隐式转换为整数"
任何帮助将不胜感激