Gem install behind corporate proxy

Hello, i’m tryng to install gem package on my vm. Downloads from internet require a proxy authentication using DOMAIN\username

Declaring proxy as environment variable works for all the downloads, but doesn’ t work with gem.

Exception `URI::InvalidURIError’ at /opt/rh/rh-ruby27/root/usr/share/ruby/uri/rfc3986_parser.rb:67 - bad URI(is not URI?): “http://DOMAIN\\username:password@proxyserver:proxyport”
ERROR: While executing gem … (URI::InvalidURIError)

Same issue when using the directive --http-proxy

Could you please tell me how to correctly set the proxy?

Thanks and regards
Ivan

try to uri encode backslash after domain:

"http://DOMAIN%5Cusername:password@proxyserver:proxyport"
  • List item

I understand that your thread is from a year ago, and you were seeking help with gem installation behind a corporate proxy. Proxy configurations can be challenging, and it’s essential to ensure they’re set up correctly.