I get the following error now (didn't really change code, but started happening):
undefined method `downcase' for nil:NilClass
I have this in my controller after authenticating with OmniAuth (and getting/storing the access token/secret
7 def show
8 @user = User.find(params[:id])
9 @client = LinkedIn::Client.new(ENV["LINKEDIN_KEY"], ENV["LINKEDIN_SECRET"])
10 @client.authorize_from_access(@user.atoken, @user.asecret)
11 if @user == current_user
12 @cl开发者_Go百科ient.profile
13 else
14 @client.profile(:id => @user.uid)
15 end
16 end
Driving me crazy trying to find the problem.
If you paste the complete stacktrace I can give a better solution, but basically, one of the parameters you're passing to one of the methods there, is nil.
Most probably on one of these two lines
@client = LinkedIn::Client.new(ENV["LINKEDIN_KEY"], ENV["LINKEDIN_SECRET"])
@client.authorize_from_access(@user.atoken, @user.asecret)
And if it "just" started happening, without a code change, I would bet my 2 cents that one of the ENV properties is returning nil
精彩评论