XNSIO
  About   Slides   Home  

 
Managed Chaos
Naresh Jain's Random Thoughts on Software Development and Adventure Sports
     
`
 
RSS Feed
Recent Thoughts
Tags
Recent Comments

Proxy Issues while installing Rails Plugins

I’m trying to install restful_authentication plugin on a rails project on a Windows platform.

Every time I try “ruby script\plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication/”

I get the following error:

Plugin not found: [“http://svn.techno-weenie.net/projects/plugins/restful_authentication/”]

This really does not help. When you pass the verbose parameter to the install command, it give a more meaningful error message.

ruby script\plugin -v install http://svn.techno-weenie.net/projects/plugins/restful_authentication/
Plugins will be installed using http fetching from ‘http://svn.techno-weenie.net/projects/plugins/restful_authentication/’
Plugin not found: [“http://svn.techno-weenie.net/projects/plugins/restful_authentication/”]
# openuri::httperror: /openuri::httperror:

When you search for this error, it becomes very clear that its a proxy issue. Following is the solution given by Nick Chistyakov

This `407 Proxy Authentication Required’ happens because along with proxy address and proxy port two additional params must by supplied:
1. user
2. password

In open-uri.rb (under \ruby\lib\ruby\1.8 folder), method OpenURI.open_http, line 216 there is a record:
klass = Net::HTTP::Proxy(proxy.host, proxy.port)

The full signature of that Net::HTTP::Proxy(…) method is:
def Net::HTTP.Proxy(p_addr, p_port = nil, p_user = nil, p_pass = nil)
So just add proxy.user, proxy.password:

klass = Net::HTTP::Proxy(proxy.host, proxy.port, proxy.user, proxy.password)

Note that your environment variable http_proxy must be set in a way it described above (http_proxy=http://user:password@host:port)


    Licensed under
Creative Commons License