Как использовать гем IMDB - PullRequest
0 голосов
/ 22 апреля 2020

Я пытаюсь использовать гем IMDB, но он возвращает следующие ошибки:

Failed to open TCP connection to akas.imdb.com:80 (getaddrinfo: nodename nor servname provided, or not known) (SocketError)
`initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)

Я пытался разрешить его, но все равно получаю ту же ошибку. Я читаю где-то, чтобы изменить DNS, но я все еще получаю эту ошибку.

Divyanshu-MacBook-Air-1133:~ divyanshu$ imdb Star Trek
IMDB Scraper 0.8.1

 - searching for "Star Trek"
/Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:30: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
Traceback (most recent call last):
    25: from /Users/divyanshu/.rbenv/versions/2.7.1/bin/imdb:23:in `<main>'
    24: from /Users/divyanshu/.rbenv/versions/2.7.1/bin/imdb:23:in `load'
    23: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/bin/imdb:10:in `<top (required)>'
    22: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/cli.rb:55:in `execute'
    21: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/cli.rb:74:in `search_movie'
    20: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:21:in `movies'
    19: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:42:in `exact_match?'
    18: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:26:in `document'
    17: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:30:in `query'
    16: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:19:in `open'
    15: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:50:in `open'
    14: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:744:in `open'
    13: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:174:in `open_uri'
    12: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:233:in `open_loop'
    11: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:233:in `catch'
    10: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:235:in `block in open_loop'
     9: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:764:in `buffer_open'
     8: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:346:in `open_http'
     7: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:932:in `start'
     6: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
     5: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:958:in `connect'
     4: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
     3: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
     2: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
     1: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:960:in `open'
/Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:960:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
    25: from /Users/divyanshu/.rbenv/versions/2.7.1/bin/imdb:23:in `<main>'
    24: from /Users/divyanshu/.rbenv/versions/2.7.1/bin/imdb:23:in `load'
    23: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/bin/imdb:10:in `<top (required)>'
    22: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/cli.rb:55:in `execute'
    21: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/cli.rb:74:in `search_movie'
    20: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:21:in `movies'
    19: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:42:in `exact_match?'
    18: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:26:in `document'
    17: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/imdb-0.8.1/lib/imdb/search.rb:30:in `query'
    16: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:19:in `open'
    15: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:50:in `open'
    14: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:744:in `open'
    13: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:174:in `open_uri'
    12: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:233:in `open_loop'
    11: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:233:in `catch'
    10: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:235:in `block in open_loop'
     9: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:764:in `buffer_open'
     8: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/open-uri.rb:346:in `open_http'
     7: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:932:in `start'
     6: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
     5: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:958:in `connect'
     4: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
     3: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
     2: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
     1: from /Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:960:in `open'
/Users/divyanshu/.rbenv/versions/2.7.1/lib/ruby/2.7.0/net/http.rb:960:in `initialize': Failed to open TCP connection to akas.imdb.com:80 (getaddrinfo: nodename nor servname provided, or not known) (SocketError)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...