Install gems from behind corporate firewall

Ram Iyer

22 Jul, 2014 09:50 PM

Hello,

I using capistrano to deploy a rails application to stage and production instances which are behind the corporate firewall. When capistrano tries to run the "bundle install" it is encountering errors -

I would guess that due to load balancing you are probably hitting a bunch of different IP's that aren't specified in your firewall rules. If they are using EC2 then it might be impossible to give you a definite list of static IP's.

Do you have a proxy? That would probably be more reliable.

First test directly on your box without Capistrano and try a simple 'gem install' command to verify that the issue isn't with Bundler or Capistrano.

To set proxy in your environment use:
export https_proxy=http://user:password@host:port
# sometimes it needs to be uppercase depending on the OS
export HTTPS_PROXY=http://user:password@host:port