Bundler: Install gems behind a proxy

Updated . Posted . Visible to the public.

To install gems Bundler needs to be able to talk to https://api.rubygems.org.

If you are behind a proxy you can use the https_proxy environment variable:

https_proxy=http://myproxy:123 bundle install

Note that if there is no https_proxy env variable, Bundler will also look for a http_proxy env variable.

With Capistrano

Ideally the server you're deploying on exports an https_proxy variable for all shells.

If you don't have control over the server setup, you can also add this to your Capistrano config:

set :bundle_env_variables, { 'https_proxy' => 'http://myproxy:123' }
Henning Koch
Last edit
Henning Koch
Keywords
rubygems
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2016-02-01 09:47)