Tag Archives: Proxy

Debian/Ubuntu’s apt behind a proxy

To allow the Advanced Packaging Tool, or just APT for friends to do its job when the box is behind a proxy, we can use one of the following options.

From the command line (this will only work for the session we are working on):

export http_proxy=http://username:password@server:port

Or if the proxy does not require a username:

export http_proxy=http://server:port

Another option is to add the following line into the file /etc/apt/apt.conf (note the semicolon at the end):

Acquire::http::Proxy "http://username:password@server:port";

Instalar Ruby on Rails estando detrás un proxy

Cuando nos encontramos detrás de un proxy, al querer instalar Ruby on Rails usando RubyGems (el administrador de paquetes de Ruby) según las instrucciones de su website, pueden aparecer errores como esto:

C:\>gem install rails --include-dependencies
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
ERROR:  http://gems.rubyforge.org/ does not appear to be a repository
ERROR:  could not find gem rails locally or in a repository
C:\>

Para solucionarlo y poder instalar Rails (o algún otro paquete mediante el comando gem install) sin problemas, basta con definir la variable http_proxy y darle como valor la dirección y puerto de nuestro servidor de proxy. En windows, sería algo como esto:

C:\>set http_proxy=http://[servidorproxy]:[puerto]

Y ya luego, nuevamente el comando:

C:\>gem install rails --include-dependencies
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Successfully installed rake-0.8.1
Successfully installed activesupport-2.1.0
Successfully installed activerecord-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activeresource-2.1.0
Successfully installed rails-2.1.0
....

Y listo.