How can I set a proxy server for gem?

后端 未结 7 489
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 17:47

I am unable to install SASS through command prompt.

I tried below steps

c:\\gem install sass

I am getting below error:

         


        
相关标签:
7条回答
  • 2020-11-30 17:55

    You need to write this in the command prompt:

    set HTTP_PROXY=http://your_proxy:your_port
    
    0 讨论(0)
  • 2020-11-30 17:56

    For http/https proxy with or without authentication:

    Run one of the following commands in cmd.exe

    set http_proxy=http://your_proxy:your_port
    set http_proxy=http://username:password@your_proxy:your_port
    set https_proxy=https://your_proxy:your_port
    set https_proxy=https://username:password@your_proxy:your_port
    
    0 讨论(0)
  • 2020-11-30 17:58

    You can try export http_proxy=http://your_proxy:your_port

    0 讨论(0)
  • 2020-11-30 17:59

    In Addition to @Yifei answer. If you have special character like @, &, $

    You have to go with percent-encode | encode the special characters. E.g. instead of this:

    http://foo:B@r@http-gateway.domain.org:80
    

    you write this:

    http://foo:B%40r@http-gateway.domain.org:80
    

    So @ gets replaced with %40.

    0 讨论(0)
  • 2020-11-30 18:11

    When setting http_proxy and https_proxy, you are also probably going to need no_proxy for URLs on the same side of the proxy. https://msdn.microsoft.com/en-us/library/hh272656(v=vs.120).aspx

    0 讨论(0)
  • 2020-11-30 18:16

    You need to add http_proxy and https_proxy environment variables as described here.

    0 讨论(0)
提交回复
热议问题