RubyGems for proxy: InvalidArgument

Another question (here :) had solutions that I tried, but they did not work.

I am for a proxy at work and cannot figure out how to get RubyGems to work through it.

Here are some results that will help:

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)

Any ideas? I am puzzled.

+3
source share
2 answers

Just skip the proxy URL as an argument --http-proxy.

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

Another way is to set the HTTP_PROXY environment variable, just make sure that when u declare it, you omit http: // in the proxy url so that the line looks like this:

set HTTP_PROXY = username:password@yourproxy:port

Hope this helps

+1
source

Source: https://habr.com/ru/post/1752488/


All Articles