Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use http_proxy setting from gemrc if present #1798

Closed
wants to merge 1 commit into from

2 participants

Fabian Ruff Don't Add Me To Your Organization a.k.a The Travis Bot
Fabian Ruff

Since bundler 1.1 the http_proxy setting from the gemrc file is not used anymore when fetching remote gems. Instead bundler always sticks to the http_proxy environment var.

This patch favors the proxy settings from the ruby gems configuration over the environment variables if present.

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request fails (merged 267436a into b3e9c1a).

Fabian Ruff

Any chance this might be considered?.
The bundler 1.1.x release is not usable for me because if this.

I use bundler/gem with internal repositories that are not available through my companies http proxy.
Bundler 1.0.x used to stick to the http_proxy setting from the .gemrc but bundler 1.1.x always sticks to the proxy env vars if they are present.

Fabian Ruff

This pull request is superseded by #2274

Fabian Ruff databus23 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/bundler/fetcher.rb
7 lib/bundler/fetcher.rb
View
@@ -43,7 +43,12 @@ def download_gem_from_uri(spec, uri)
def initialize(remote_uri)
@remote_uri = remote_uri
@has_api = true # will be set to false if the rubygems index is ever fetched
- @@connection ||= Net::HTTP::Persistent.new nil, :ENV
+ proxy_config = case Gem.configuration[:http_proxy]
+ when String then URI.parse Gem.configuration[:http_proxy]
+ when :no_proxy then nil
+ else :ENV
+ end
+ @@connection ||= Net::HTTP::Persistent.new nil, proxy_config
end
# fetch a gem specification
Something went wrong with that request. Please try again.