【问题标题】:SocketError when trying to install Ruby Gems for windows XP尝试为 Windows XP 安装 Ruby Gems 时出现 SocketError
【发布时间】:2013-01-21 11:55:50
【问题描述】:

我正在尝试安装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)

你能帮我完成它吗?

【问题讨论】:

  • 谁能帮我说说为什么会这样?
  • 企业防火墙,我恨你:)
  • 删除标签:这不是 Nokogiri、Mechanize 或 Selenium 问题。

标签: ruby windows-xp


【解决方案1】:

您的错误似乎是代理问题, 试试下面的命令

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

【讨论】:

  • +1 给你!它的工作。我在C:\Ruby193>gem install --http-proxy 3.209.30.25:80 nokogiri 下尝试并且所有下载都已开始。
猜你喜欢
  • 2013-07-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多