twitter / twurl

OAuth-enabled curl for the Twitter API
https://developer.twitter.com
MIT License
1.8k stars 301 forks source link

undefined method <=> for :x_auth_username:Symbol #23

Closed ghost closed 12 years ago

ghost commented 12 years ago

Here is a mostly complete stack trace...

/Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/helper.rb:37:in `<=>': undefined method `<=>' for :x_auth_username:Symbol (NoMethodError)
    from /Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/helper.rb:37:in `sort'
    from /Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/helper.rb:37:in `normalize'
    from /Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:359:in `create_http_request'
    from /Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:187:in `create_signed_request'
    from /Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:159:in `request'
    from /Library/Ruby/Gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:194:in `token_request'
    from /Library/Ruby/Gems/1.8/gems/twurl-0.7.0/bin/../lib/twurl/oauth_client.rb:85:in `exchange_credentials_for_access_token'
    from /Library/Ruby/Gems/1.8/gems/twurl-0.7.0/bin/../lib/twurl/authorization_controller.rb:6:in `dispatch'
    from /Library/Ruby/Gems/1.8/gems/twurl-0.7.0/bin/../lib/twurl/abstract_command_controller.rb:7:in `dispatch'
    from /Library/Ruby/Gems/1.8/gems/twurl-0.7.0/bin/../lib/twurl/cli.rb:31:in `dispatch'
    from /Library/Ruby/Gems/1.8/gems/twurl-0.7.0/bin/../lib/twurl/cli.rb:14:in `run'
    from /Library/Ruby/Gems/1.8/gems/twurl-0.7.0/bin/twurl:4
    from /usr/bin/twurl:19:in `load'
    from /usr/bin/twurl:19

I fixed this locally by changing Twurl::OAuthClient#client_auth_parameters to return strings instead of symbols...

    def client_auth_parameters
      {'x_auth_username' => username, 'x_auth_password' => password, 'x_auth_mode' => 'client_auth'}
    end

Maybe this is a OAuth issue?

desandro commented 12 years ago

Had the same issue. Thank you @axelator for the hotfix.