How do I install rails on a Windows machine that uses a proxy server to get to the internet?

后端 未结 1 644
情书的邮戳
情书的邮戳 2021-02-10 14:42

I\'m a big fan of the ruby way. However today it got in my way.

The defacto way of installing rails (i\'m running as a domain user on a WinXP machine) is

  • d
1条回答
  •  孤城傲影
    2021-02-10 15:11

    Well another battle ends.. with a victory. Turns out the proxy server can be specified after all. However the documented -p and --http-proxy command line switches don't work for some reason or I wasn't smart enough to figure out the right incantation.

    >ruby -v
    ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
    >gem -v
    1.3.5 
    >gem query -p http
    ERROR:  While executing gem ... (OptionParser::InvalidArgument)
        invalid argument: -p http
    

    Just for trying everything I could I tried setting the HTTP_PROXY environment variable on the windows command line as mentioned in the WolfByte's answer to this SO question (that i stumbled upon after search keyword bingo on google). AND IT WORKED!!!

    >SET HTTP_PROXY=http://username:password@proxy:port
    >gem update --system
    >gem install rails
    

    Guess SO needs a new tag-line "The answer is in there" ala XFiles. You just need to wrestle with Google to get to it. Hope this helps the next person

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