私は宝石を使用していtwitter_oauth
ます。トークンを入れると、access_token
. このハッシュの情報にアクセスしたいのですが、何らかの理由でアクセスできません。私ができる最善のことは、それを調べることです:
access_token.inspect #=>
#<OAuth::AccessToken:0x72ca83b2 @params={:oauth_token=>"token (filtered of course)", "oauth_token"=>"token", :oauth_token_secret=>"secret", "oauth_token_secret"=>"secret", :user_id=>"id", "user_id"=>"id", :screen_name=>"Imnotanerd", "screen_name"=>"Imnotanerd"}, @response=#<Net::HTTPOK 200 OK readbody=true>, @consumer=#<OAuth::Consumer:0x6bb7645d @http_method=:post, @options={:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token", :authorize_path=>"/oauth/authenticate", :access_token_path=>"/oauth/access_token", :proxy=>nil, :scheme=>:header, :http_method=>:post, :oauth_version=>"1.0", :site=>"http://api.twitter.com", :request_endpoint=>nil}, @secret="secret", @http=#<Net::HTTP api.twitter.com:80 open=false>, @uri=#<URI::HTTP:0x384bc24e URL:http://api.twitter.com>, @key="key">, @token="token", @secret="secret">
私は次のように値にアクセスしようとしました:
access_token[params]["user_id"] #gave up on this due to me reasoning that it's confusing params with the routing variable, params
access_token["params"]["user_id"]
access_token["consumer"]["secret"]
そして、これらすべてが内部サーバー エラーを引き起こしました。エラーが報告されたとき、他の情報は提供されませんでした。
JRuby 1.7 RC2 と最新の Trinidad Web サーバーを使用しています。WEBrickでもこれを試しましたが、同じエラーが表示されます。