help with OAuth unitialized constant OAuth::VERSION

Discussion in 'Ruby' started by Samuel Sternhagen, Aug 19, 2010.

  1. I am trying to authenticate to Etsy.com's web server using OAuth.
    I am getting this error:

    /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/client/helper.rb:64:in
    `amend_user_agent_header': uninitialized constant OAuth::VERSION
    (NameError)
    from
    /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/client/net_http.rb:28:in
    `oauth!'
    from /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:225:in
    `sign!'
    from /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:191:in
    `create_signed_request'
    from /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:162:in
    `request'
    from /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:197:in
    `token_request'
    from /var/lib/gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:139:in
    `get_request_token'
    from ./oauth.rb:8
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
    `gem_original_require'
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from oauth.rb:3


    My ruby version is: ruby 1.8.7 (2010-01-10 patchlevel 249)
    [x86_64-linux]

    #below is the actual code I am using with the key and secret replaced

    # not sure what I should require here
    require 'net/http'
    require 'net/https'
    require 'rubygems'
    require 'oauth'
    require 'oauth/consumer'

    @consumer = OAuth::Consumer.new("my_key", "my_secret", {:site =>
    "http://openapi.etsy.com/v2/sandbox/private/oauth/request_token"})

    @request_token = @consumer.get_request_token
    print @request_token


    I believe this is the correct code, however, I cannot get it to run. Do
    you have any ideas?

    Thanks,

    Sam
    --
    Posted via http://www.ruby-forum.com/.
     
    Samuel Sternhagen, Aug 19, 2010
    #1
    1. Advertising

  2. Samuel Sternhagen, Aug 19, 2010
    #2
    1. Advertising

  3. Samuel Sternhagen

    Rudy Mcgoss Guest

    Samuel Sternhagen wrote:
    > oauth (0.4.2)


    That doesn't work for me.

    $ gem list oauth
    gem list oauth

    *** LOCAL GEMS ***

    oauth (0.4.2)

    $ irb

    >> gem 'oauth'
    >> require 'oauth/consumer'
    >> @consumer = OAuth::Consumer.new( 'key', 'secret', { :site => 'http://term.ie/oauth/example/request_token.php' } )
    >> @request_token = @consumer.get_request_token

    NameError: uninitialized constant OAuth::VERSION
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/client/helper.rb:64:in
    `amend_user_agent_header'
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/client/net_http.rb:28:in
    `oauth!'
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:225:in
    `sign!'
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:191:in
    `create_signed_request'
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:162:in
    `request'
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:197:in
    `token_request'
    from
    /Library/Ruby/Gems/1.8/gems/oauth-0.4.2/lib/oauth/consumer.rb:139:in
    `get_request_token'
    from (irb):5

    --
    Posted via http://www.ruby-forum.com/.
     
    Rudy Mcgoss, Aug 20, 2010
    #3
  4. Samuel Sternhagen

    Jonas B. Guest

    Jonas B., Jan 18, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darrell Grainger

    Re: Unitialized Memory Read In sscanf()

    Darrell Grainger, Jun 24, 2003, in forum: C Programming
    Replies:
    1
    Views:
    827
    Alan Balmer
    Jun 24, 2003
  2. Eric Sosman

    Re: Unitialized Memory Read In sscanf()

    Eric Sosman, Jun 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    855
    Eric Sosman
    Jun 24, 2003
  3. V Green
    Replies:
    0
    Views:
    885
    V Green
    Feb 5, 2008
  4. PA Bear [MS MVP]
    Replies:
    0
    Views:
    1,000
    PA Bear [MS MVP]
    Feb 5, 2008
  5. Michael Linfield

    Ruport::DataSet unitialized constant?

    Michael Linfield, Aug 15, 2007, in forum: Ruby
    Replies:
    1
    Views:
    119
    Stefan Mahlitz
    Aug 15, 2007
Loading...

Share This Page