jjr2527
jjr2527

Reputation: 440

Installing Ruby Gems behind a Proxy

It appears this topic has been covered a few times before, but those solutions have only gotten me so far. I now have my sources properly updated and I am able to query for gems without an error but I keep getting empty results for my searches.

I installed rubysspi and copied over the spa.rb file as mentioned in the readme.

The readme also suggested using this line which did not work for me based on my install path:

ruby -rspa 'C:\Program Files\ruby\gem' list --remote sspi

So I switched it to my install directory off the root:

ruby -rspa 'C:\ruby\gem' list --remote sspi

But that also didn't work so a search for the gem file located it in the bin directory so this command finally worked for me:

ruby -rspa 'C:\ruby\bin\gem' list --remote sspi

But I got empty results back:

*** REMOTE GEMS ***

SO I tried other gems and had the same results. Then I listed my gem sources and rubygems is listed as expected. Am I missing something else?

c:\ruby>gem sources

*** CURRENT SOURCES ***

http://rubygems.org

Upvotes: 0

Views: 2488

Answers (3)

root
root

Reputation: 582

Try this:

sudo HTTP_PROXY="http://10.3.100.207:8080" gem install bundler

Replace "10.3.100.207" with your host and "8080" with your "port value"

It worked for me.

Or try this:

sudo HTTP_PROXY="http://10.3.100.207:8080" or sudo export HTTP_PROXY="http://10.3.100.207:8080"

Also do with https and HTTPS as I faced problem once due to this.

Upvotes: 1

jjr2527
jjr2527

Reputation: 440

I never ended up getting gems to install behind my company's proxy. Instead I ended up downloading the gems directly and then installing them from my local downloads folder.

Upvotes: 0

glenn jackman
glenn jackman

Reputation: 246837

Set the environment variable http_proxy to the http://host:port of your proxy server.

Upvotes: 2

Related Questions