Errno :: ECONNREFUSED无法建立连接,因为 [英] Errno::ECONNREFUSED No connection could be made because

查看:834
本文介绍了Errno :: ECONNREFUSED无法建立连接,因为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装红宝石宝石时遇到问题。当我运行

I'm having trouble installing ruby gems. When I run

gem install compass

我遇到以下错误

ERROR:  Could not find a valid gem 'compass' (>= 0), here is why: 
Unable to download data from https://rubygems.org/ 
- no such name (https://rubygems.org/latest_specs.4.8.gz)

试图找到这个特定问题的答案,我可以得出结论(借助google ),我在公司代理服务器后面的事实正在阻止与Rubygems.org的连接。

Having tried to find the answer to this particular problem I can to the conclusion (with the help of google) that the fact I'm behind a corporate proxy is blocking the connection to Rubygems.org

因此,通过更多的谷歌搜索,我发现人们已经成功地使用了该命令在代理后面连接时

So with a bit more googling I found this command that people have used to succesfully connect when behind a proxy

gem install compass --http-proxy=http://%USERNAME%:%PASSWORD%@%PROXY_SERVER%:%PROXY_PORT_NUMBER%

已运行此命令替换了我没有得到的相关信息

Having run this command substituting in the relevant information I'm not getting a different error.

ERROR:  Could not find a valid gem 'compass' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: 
No connection could be made because the target machine actively refused it.
- connect(2) (https://rubygems.org/latest_specs.4.8.gz)

我没有运气找到可能的原因,有人可以帮忙吗?

I've had no luck finding what could be cuasing it, can anyone help?

或者,有人知道不使用SASS和/或Compass的安装方法吗?

Alternatively does anyone know of a way to install SASS and or Compass without using a Ruby CLI?

仅供参考。我尝试了一些SASS预处理器应用程序(PREPOS)和指南针应用程序,但对于该项目,我们需要SASS和COMPASS的特定版本,并且我似乎无法降级它们。

FYI I've tried a few SASS Preprocessor apps (PREPOS) and the compass app but we need specific versions of both SASS and COMPASS for this project and i can't seem to downgrade them.

非常感谢

推荐答案

尝试使用环境变量设置代理:

Try to use environment variables to set the proxies:

export http_proxy="http://user:pass@server.com:port"
export HTTP_PROXY="http://user:pass@server.com:port"

然后尝试正常安装gem。

and then try to install the gem normally.

要测试代理环境,可以使用cURL或wget:

To test the proxy environment you can use cURL or wget:

curl -I http://stackoverflow.com
wget http://stackoverflow.com

阅读此问题,如果您想了解大小写变量名。

Read this question if you want to know about the upper and lower case variable names.

这篇关于Errno :: ECONNREFUSED无法建立连接,因为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆