net/http.rb:560:in `initialize': getaddrinfo: Name or service not known (SocketError)

前端 未结 2 1182
梦谈多话
梦谈多话 2021-01-02 09:50
@@timestamp = nil

def generate_oauth_url
  @@timestamp = timestamp
  url = CONNECT_URL + REQUEST_TOKEN_PATH + \"&oauth_         


        
2条回答
  •  借酒劲吻你
    2021-01-02 09:56

    You also get this error when you have no internet connection since a DNS lookup is often the first thing that happens when establishing a TCP connection using a hostname.

    Unplug your network cable and try:

    Socket.getaddrinfo("www.example.com", "http")
    # => SocketError: getaddrinfo: nodename nor servname provided, or not known
    

提交回复
热议问题