我试图在Windows上安装和配置'OpenShift‘。我安装了必要的工具,如: Git、RubyGem 2.x,但是当我试图安装'rhc‘RubyGem时,我得到了以下错误:
C:\>ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [x64-mingw32]
C:\>gem install rhc
ERROR: Could not find a valid gem 'rhc' (>= 0) in any repositor
C:\>我一直在网上搜索这个问题,但没有成功.
当我运行以下命令:$gem源代码时,我得到了以下命令。
C:\>gem sources
*** CURRENT SOURCES ***
C:\>这里好像有什么不对劲,但是的,我照你的意思做了。我“补充”了消息来源但是..。
C:\>gem source -a http://rubygems.org
[https://rubygems.org][1] is recommended for security over http://rubygems.org
Do you want to add this insecure source? [yn] y
Error fetching [http://rubygems.org][1]:
no such name (http://rubygems.org/specs.4.8.gz)
C:\>伙计们,我该怎么办?我读了这么多论坛和其他网页,但没有一个能解决这个问题。
附加信息: Windows 7 (x64),Ruby2.1.6(实际上我已经安装了Ruby2.2,但我在一些论坛上发现,这个问题可以修复到Ruby的旧版本)。我使用代理将我与互联网连接起来。
更新信息.
C:\>gem install rhc --source http://rubygems.org
ERROR: Could not find a valid gem 'rhc' (>= 0), here is why:
Unable to download data from http://rubygems.org/ - no such name (http://rubygems.org/specs.4.8.gz)
C:\>gem sources -c
*** Removed specs cache ***
C:\>gem sources -u
source cache successfully updated
C:\>gem install rhc --source http://rubygems.org
ERROR: Could not find a valid gem 'rhc' (>= 0), here is why:
Unable to download data from http://rubygems.org/ - no such name (http://rubygems.org/specs.4.8.gz)
C:\>发布于 2015-07-14 20:28:27
因此,您在注释(你在代理的背后)中共享的重要信息意味着,为了通过代理使用rubygems,您必须设置一些环境变量。
在cmd.exe中使用:
set http_proxy=http://user:password@proxy_ip:port或在PowerShell中
$env:http_proxy=http://user:password@proxy_ip:port有一种情况是,必须使用格式无效和不同的格式:
http_proxy = proxy_ip:port
http_proxy_user = user
http_proxy_pass = password域用户
首先尝试不使用域前缀,除非您知道默认域没有设置,或者您的域不是默认域。
使用域用户登录和domain\user格式,必须使用其对应的domain\user替换\:百分比编码
http://domain%5Cuser:password@proxy_ip:porthttps://stackoverflow.com/questions/31341229
复制相似问题