Ruby 在代理后安装绑定器Gem
我在从代理服务器后面安装bundler gem时遇到问题Ruby 在代理后安装绑定器Gem,ruby,windows,proxy,bundler,Ruby,Windows,Proxy,Bundler,我在从代理服务器后面安装bundler gem时遇到问题 $ gem install bundler --http-proxy http://my.proxy/proxy.pac:80 ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response No
$ gem install bundler --http-proxy http://my.proxy/proxy.pac:80
ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Not Found 404 (http://rubygems.org/latest_specs.4.8.gz)
$ rails -v
Rails 4.1.1
$ ruby --version
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
有人对如何解决这些错误有什么建议吗?我认为gem不支持评估
.pac
文件。您需要直接为其提供正确的代理配置。请尝试以下操作:
sudo HTTP_代理=”http://10.3.100.207:8080“gem安装绑定器
用主机替换“10.3.100.207”,用“端口值”替换“8080”
或者试试这个:
sudo HTTP_代理=”http://10.3.100.207:8080“或sudo导出HTTP_代理=”http://10.3.100.207:8080"
也可以使用https和https,因为我曾经因此遇到过问题。来自
gem help install
文档:
sudo gem install bundler -p http://myawesome.proxy.com:1234
你能买到其他宝石吗?或者这是bundler特有的问题?不,我不能。我在我尝试的任何gem上都会遇到相同的错误。你能通过其他方式访问internet吗,如apt get(假设你在linux上)?我在Windows 7 SP 1上,我收到Ping请求,但找不到主机。你是对的。然而,我现在得到了一个407错误:
$gem安装绑定器--http代理http://myusername:mypassword@my.proxy:8080错误:在任何存储库中找不到有效的gem“bundler”(>=0)。错误:在执行gem时。。。(Gem::RemoteFetcher::FetchError)需要错误响应代理身份验证407(http://rubygems.org/latest_specs.4.8.gz)
尝试使用环境变量,如中所述