ruby下gem-fast設(shè)置代理錯(cuò)誤
有時(shí)候公司內(nèi)網(wǎng)需要設(shè)置HTTP代理才能連接公網(wǎng),下面列出一些Gem及Git的代理設(shè)置方法
設(shè)置Git代理
$git config --global http.proxy http://192.128.1.3:80
$ git config -l
http.proxy=http://192.128.1.3:80
設(shè)置Gem代理
$ export http_proxy=http://192.128.1.3:80
gem install rails --http-proxy $http_proxy
讓Bundler使用HTTP代理環(huán)境設(shè)置
sudo -E bundle ...
非Root用戶設(shè)置代理后gem-fast會(huì)報(bào)錯(cuò)
如果你是非root用戶,比如用Git用戶設(shè)置http代理后,使用gem-fast會(huì)報(bào)如下錯(cuò)誤:
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
目前的還沒找到根本的解決辦法,原因是授權(quán)的問題,因?yàn)閞oot用戶執(zhí)行就不報(bào)錯(cuò),所以只能卸載gem-fast,這樣就不報(bào)錯(cuò)了,但是就不能使用gem-fast的快速下載功能了。那位牛人能解決這個(gè)問題請告之小弟,謝謝!
2013-06-12
posted on 2013-06-13 07:58 kuuyee 閱讀(2425) 評論(0) 編輯 收藏 所屬分類: Ruby/Python/Ceylon