Skip to content

NoMethodError: undefined method `<=>' for :method:Symbol #44

@cbolanos79

Description

@cbolanos79

Hello,

I got this error trying to upload a video:

NoMethodError: undefined method <=>' for :method:Symbol from /var/lib/gems/1.8/gems/oauth-0.4.7/lib/oauth/helper.rb:37:in<=>'
from /var/lib/gems/1.8/gems/oauth-0.4.7/lib/oauth/helper.rb:37:in sort' from /var/lib/gems/1.8/gems/oauth-0.4.7/lib/oauth/helper.rb:37:innormalize'
from /var/lib/gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:362:in create_http_request' from /var/lib/gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:187:increate_signed_request'
from /var/lib/gems/1.8/gems/oauth-0.4.7/lib/oauth/consumer.rb:159:in request' from /var/lib/gems/1.8/gems/vimeo/lib/vimeo/advanced/base.rb:104:inmake_request'
from (eval):13:in `get_quota'

Problem is located at lib/vimeo/advanced/base.rb:99

raw_response = @oauth_consumer.request(:post, Vimeo::Advanced::Base::ENDPOINT, get_access_token, {}, options).body

OAuth::Helper#normalize expects to receive options hash keys as string not symbols:

def normalize(params)
  params.sort.map do |k, values|

So I did this change on def make_request:

      options_strings = {}
      options_strings = options.map{|k,v| {k.to_s => v}}.reduce(:merge)

      #raw_response = @oauth_consumer.request("post", Vimeo::Advanced::Base::ENDPOINT, get_access_token, {}, options).body
      raw_response = @oauth_consumer.request("post", Vimeo::Advanced::Base::ENDPOINT, get_access_token, {}, options_strings).body

Tried again and worked right.
Hope this helps you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions