1

nokogiri、をインストールしようとしていますがselenium-webdriver、次のmechanizeようなエラーが発生します。

ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

C:\Documents and Settings\pp>gem install nokogiri
ERROR:  Could not find a valid gem 'nokogiri' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/lates
t_specs.4.8.gz)

C:\Documents and Settings\pp>gem install nokogiri
ERROR:  Could not find a valid gem 'nokogiri' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/lates
t_specs.4.8.gz)

C:\Documents and Settings\pp>gem install selenium-webdriver
ERROR:  Could not find a valid gem 'selenium-webdriver' (>= 0) in any repository

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/lates
t_specs.4.8.gz)

C:\Documents and Settings\pp>gem install selenium
ERROR:  Could not find a valid gem 'selenium' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/lates
t_specs.4.8.gz)

それを成し遂げるのを手伝ってくれませんか。

4

1 に答える 1

5

エラーはプロキシの問題のようです。次のコマンドを試してください

gem install --http-proxy <your proxy host:port> <your gem name>

例えば。

gem install --http-proxy http://localhost:8888 selenium-webdriver

あなたもすることができます

SET HTTP_PROXY=http://%USER%:%PASSWORD%@%SERVER%:%PORT%

次に、gem install

于 2013-01-21T13:23:54.653 に答える