net / http.rb: 560: dans `initialize ': getaddrinfo: Nom ou service inconnu (SocketError)

@@timestamp = nil

def generate_oauth_url
  @@timestamp = timestamp
  url = CONNECT_URL + REQUEST_TOKEN_PATH + "&oauth_callback=#{OAUTH_CALLBACK}&oauth_consumer_key=#{OAUTH_CONSUMER_KEY}&oauth_nonce=#{NONCE}    &oauth_signature_method=#{OAUTH_SIGNATURE_METHOD}&oauth_timestamp=#{@@timestamp}&oauth_version=#{OAUTH_VERSION}"
  puts url
  url             
end

def sign(url)
  Base64.encode64(HMAC::SHA1.digest((NONCE + url), OAUTH_CONSUMER_SECRET)).strip
end

def get_request_token
  url = generate_oauth_url
  signed_url = sign(url)          
  request = Net::HTTP.new((CONNECT_URL + REQUEST_TOKEN_PATH),80)
  puts request.inspect
  headers = { "Authorization" => "Authorization: OAuth oauth_nonce = #{NONCE}, oauth_callback = #{OAUTH_CALLBACK}, oauth_signature_meth    od = #{OAUTH_SIGNATURE_METHOD}, oauth_timestamp=#{@@timestamp}, oauth_consumer_key = #{OAUTH_CONSUMER_KEY}, oauth_signature = #{signed_url}, oauth_versio    n = #{OAUTH_VERSION}" }

  request.post(url, nil,headers)                  
end

def timestamp
  Time.now.to_i
end

Je suis en train de faire ce que oauth ne dans une tentative de comprendre comment utiliser l'Autorisation de les en-têtes. Je suis également l'erreur suivante se produit. Je suis en train d'essayer de se connecter à l'API linkedin.

/usr/lib/ruby/1.8/net/http.rb:560:in 'initialize': getaddrinfo: Name or service not known (SocketError)

Je serais vraiment reconnaissant si quelqu'un pourrait me pousser dans la bonne direction.

source d'informationauteur Sid