Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
代理背后的RubyGems:无效辩论_Ruby_Proxy_Rubygems - Fatal编程技术网

代理背后的RubyGems:无效辩论

代理背后的RubyGems:无效辩论,ruby,proxy,rubygems,Ruby,Proxy,Rubygems,另一个问题(这里:)有我尝试过的解决方案,但都不起作用 我在工作中支持一个代理,不知道如何让RubyGems通过它工作 以下是一些有帮助的输出: josiah@BOX-OF-DOOOM:/etc$ export HTTP_PROXY=http://jkiehl:supersecret@www-proxy.myproxysdomain.com:80/ josiah@BOX-OF-DOOOM:/etc$ sudo gem i cucumber ERROR: http://rubygems.org/

另一个问题(这里:)有我尝试过的解决方案,但都不起作用

我在工作中支持一个代理,不知道如何让RubyGems通过它工作

以下是一些有帮助的输出:

josiah@BOX-OF-DOOOM:/etc$ export HTTP_PROXY=http://jkiehl:supersecret@www-proxy.myproxysdomain.com:80/
josiah@BOX-OF-DOOOM:/etc$ sudo gem i cucumber
ERROR:  http://rubygems.org/ does not appear to be a repository
ERROR:  Could not find a valid gem 'cucumber' (>= 0) in any repository
josiah@BOX-OF-DOOOM:/etc$ sudo gem i -p cucumber
ERROR:  While executing gem ... (OptionParser::InvalidArgument)
    invalid argument: -p cucumber
josiah@BOX-OF-DOOOM:/etc$ sudo gem i -P cucumber
ERROR:  While executing gem ... (OptionParser::InvalidArgument)
    invalid argument: -P 
josiah@BOX-OF-DOOOM:/etc$ sudo gem i --http-proxy cucumber
ERROR:  While executing gem ... (OptionParser::InvalidArgument)

有什么想法吗?我很困惑。

只需将代理URL作为
--http proxy
参数传递即可

sudo gem install --http-proxy http://jkiehl:supersecret@www-proxy.myproxysdomain.com:80 cucumber

另一种方法是设置环境变量HTTP_PROXY,只要确保在声明它时在代理url中ommit HTTP://即可,因此该行如下所示

设置HTTP\u PROXY=username:password@yourproxy:端口


希望这有帮助

我以为它是在HTTP_代理服务器上运行的。。。非常感谢!似乎它需要这个答案中所示的方案,我尝试了
--http proxy somebox
,但没有成功:
--http proxyhttp://somebox