Installing Bundler Gem Behind Proxy

13,396

Solution 1

From gem help install documentation:

sudo gem install bundler -p http://myawesome.proxy.com:1234

Solution 2

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"

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.

Share:
13,396
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm having trouble installing the bundler gem from behind my proxy server.

    $ gem install bundler --http-proxy http://my.proxy/proxy.pac:80
    ERROR:  Could not find a valid gem 'bundler' (>= 0) in any repository
    ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
        bad response Not Found 404 (http://rubygems.org/latest_specs.4.8.gz)
    
    $ rails -v
    Rails 4.1.1
    
    $ ruby --version
    ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
    

    Anyone have suggestions on how to resolve these errors?

  • Admin
    Admin almost 10 years
    You are correct. I'm now getting a 407 error however: $ gem install bundler --http-proxy http://myusername:[email protected]:8080 ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response Proxy Authentication Required 407 (http://rubygems.org/latest_specs.4.8.gz)
  • Tim Moore
    Tim Moore almost 10 years
    Try using environment variables, as described in stackoverflow.com/a/9382152/29470