2014-09-02 116 views
2

我在安裝紅寶石寶石時遇到問題。當我運行Errno :: ECONNREFUSED無法連接,因爲

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) 

已經試圖找到答案的結論(與谷歌的幫助下)這個具體問題,我可以說的事實,我後面的企業代理阻止連接到Rubygems.org

所以多一點谷歌上搜索,我發現這個命令,人們已經習慣成功地連接使用代理時

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

運行此命令替換相關信息後,我沒有收到其他錯誤。

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) 

我有沒有運氣發現什麼可能cuasing它,任何人都可以幫助嗎?

或者,任何人都知道如何在不使用Ruby CLI的情況下安裝SASS和/或Compass?

僅供參考我已經嘗試了一些SASS預處理器應用程序(PREPOS)和指南針應用程序,但是我們需要此項目的SASS和COMPASS的特定版本,我似乎無法降級它們。

非常感謝

回答

0

嘗試設置你的HTTP_PROXYHTTPS_PROXY環境變量。例如:

HTTP_PROXY=http://%USERNAME%:%PASSWORD%@%PROXY_SERVER%:%PROXY_PORT_NUMBER% gem install compass 
2

嘗試使用環境變量設置代理服務器:

export http_proxy="http://user:[email protected]:port" 
export HTTP_PROXY="http://user:[email protected]:port" 

,然後嘗試正常安裝寶石。

要測試你可以使用捲曲或wget的代理環境:

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

閱讀this question如果你想了解的大寫和小寫的變量名。

+0

爲什麼downvotes? – 2015-05-04 09:00:39

相關問題