ruby下gem-fast設置代理錯誤
有時候公司內網需要設置HTTP代理才能連接公網,下面列出一些Gem及Git的代理設置方法
設置Git代理
$git config --global http.proxy http://192.128.1.3:80
$ git config -l
http.proxy=http://192.128.1.3:80
設置Gem代理
$ export http_proxy=http://192.128.1.3:80
gem install rails --http-proxy $http_proxy
讓Bundler使用HTTP代理環境設置
sudo -E bundle ...
非Root用戶設置代理后gem-fast會報錯
如果你是非root用戶,比如用Git用戶設置http代理后,使用gem-fast會報如下錯誤:
curl: (7) couldn't connect to host
ERROR: While executing gem ... (GemFast::Util::ExecutionError) Failure while executing: curl -f#LA rubygem-gemfast http://ruby.taobao.org/quick/Marshal.4.8/bundler-1.3.5.gemspec.rz --insecure -o /home/git/local/lib/ruby/gems/1.9.1/cache/bundler-1.3.5.gemspec.rz
目前的還沒找到根本的解決辦法,原因是授權的問題,因為root用戶執行就不報錯,所以只能卸載gem-fast,這樣就不報錯了,但是就不能使用gem-fast的快速下載功能了。那位牛人能解決這個問題請告之小弟,謝謝!
2013-06-12
posted on 2013-06-13 07:58 kuuyee 閱讀(2425) 評論(0) 編輯 收藏 所屬分類: Ruby/Python/Ceylon