omn​​iauth-facebook无法将nil转换为String

时间:2014-03-31 16:38:15

标签: ruby-on-rails omniauth

fb = OmniAuth::Strategies::Facebook.new("app_id", "app_secret")
client = OAuth2::Client.new("app_id", "app_secret", fb.options.client_options) 
token = OAuth2::AccessToken.new(client,'access_token', fb.options.access_token_options)
fb.instance_variable_set("@access_token", token) 
fb.auth_hash

当我尝试访问auth_hash时,我得到:

can't convert nil into String

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

实际上,将第一行更改为:

fb = OmniAuth::Strategies::Facebook.new(nil, "app_id", "app_secret")

解决了这个问题。我不确定第一个参数代表什么。