Issue Installing Gems on Windows 7 with Proxy

Issue installing gems on windows 7 with proxy

The HTTP_PROXY syntax needs to be URI:

SET HTTP_PROXY=scheme://user:pass@host:port/path

scheme could be http or https and on some cases path could be absent.

No browser (or RubyGems) will accept as valid URL the one you provided.

So in your case:

SET HTTP_PROXY=http://username:password@proxyhere.com:8080/

Hope that helps

How do I update Ruby Gems from behind a Proxy (ISA-NTLM)

I wasn't able to get mine working from the command-line switch but I have been able to do it just by setting my HTTP_PROXY environment variable. (Note that case seems to be important). I have a batch file that has a line like this in it:

SET HTTP_PROXY=http://%USER%:%PASSWORD%@%SERVER%:%PORT%

I set the four referenced variables before I get to this line obviously. As an example if my username is "wolfbyte", my password is "secret" and my proxy is called "pigsy" and operates on port 8080:

SET HTTP_PROXY=http://wolfbyte:secret@pigsy:8080

You might want to be careful how you manage that because it stores your password in plain text in the machine's session but I don't think it should be too much of an issue.

Error installing gem install sass windows 7

I got friends thanks to https://www.youtube.com/user/johanricardo1108/about

that have:
gem sources -a http://rubygems.org/
comfirmed and then this:
gem install sass

C:\Ruby21>gem sources -a http://rubygems.org/
https://rubygems.org is recommended for security over http://rubygems.org/

Do you want to add this insecure source? [yn] y
http://rubygems.org/ added to sources

C:\Ruby21>gem install sass
Fetching: sass-3.4.12.gem (100%)
Successfully installed sass-3.4.12
Parsing documentation for sass-3.4.12
Installing ri documentation for sass-3.4.12
Done installing documentation for sass after 6 seconds
WARNING: Unable to pull data from 'https://rubygems.org/': SSL_connect returned
=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (htt
ps://api.rubygems.org/latest_specs.4.8.gz)
1 gem installed

C:\Ruby21>sass -v
Sass 3.4.12 (Selective Steve)

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

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

Ruby on Rails issue in Windows 7 behind websense and firewall

You need to set your proxy settings for rubygems. For example set the Environment Variable like so:

SET HTTP_PROXY=http://wolfbyte:secret@pigsy:8080

From https://stackoverflow.com/a/4431/192221



Related Topics



Leave a reply



Submit