Ruby gem proxy settings

Source: Internet
Author: User

The company uses its own proxy to access the Internet. Therefore, when rubygem is used, we cannot directly install the required packages, such as rails. On the internet, we checked a lot of methods for gem to use proxy, many people write that gem supports the-p parameter to set the proxy, but I have not tried it for a long time. Now, write down the method I set successfully to avoid forgetting it later:

There are two types in Windows. The first is to use the agent software. I will leave it alone. Let's do it on your own;
Second, enter SET http_proxy = URL in the command line. the following URL is your proxy address, such as http: // 192.168.0.1: 8081 or something. After the settings, you can directly use the gem command.

Below is the official Original article:

Running gem installWhen you are behind a proxy.

Set the http_proxy environment variable.

Note This is fully qualified, as such:
Http_proxy = http: // URL: Port

Http_proxy = http: // 127.0.0.1: 5865
In this example, the proxy is running on the localhost. With NTLM authorization to get through a previous ate firewall.

NB: this may not work if you are behind a Microsoft ISA proxy server with only NTLM (ms isa Server proprietary) authentication available. if this is the case, you can try the Microsoft firewall client or the python NTLM authorization proxy server.

JB: a gem is available which gives Ruby the ability to authenticate with ISA natively. To use it with gems follow these steps:

  1. Download rubysspi from the ruby Win32 sspi project page (also available as gem install rubysspi but that doesn't help much, does it ?)
  2. Install the gem locally
  3. Copy spa. RB from the gem install to your site-Ruby directory
  4. Find gem. CMD in your ruby bin directory and add "-rspa" to the command line.
  5. Set http_proxy environment variable as abve
  6. Gem list rails

I hope this will be useful to you !!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.