gem与代理设置
来源:互联网 发布:战地4 知乎 编辑:程序博客网 时间:2024/03/28 18:56
I'm behind an authenticated proxy and RubyGems doesn't seem to support username/password based authentication.
Some investigation seems to indicate that open-uri.rb doesn't support authentication. open-uri is based on Net::HTTP
which *does* support authentication so it should be relatively easy to modify open-uri to do that too. I spent about
an hour on it, but couldn't immediately get something working (open-uri is using Net::HTTP in a somewhat quirky way).
C:/>gem -v
C:/>"c:/ruby/bin/ruby.exe" "c:/ruby/bin/gem" -v
0.8.3
C:/>gem list -p http://proxy:8080 -r --backtrace
C:/>"c:/ruby/bin/ruby.exe" "c:/ruby/bin/gem" list -p http://proxy1.macbank:8080 -r --backtrace
*** REMOTE GEMS ***
Updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (OpenURI::HTTPError)
407 Proxy Authentication Required
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:574:in `proxy_open'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:167:in `open_loop'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:164:in `catch'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:164:in `open_loop'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:134:in `open_uri'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:424:in `open'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:85:in `open'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:96:in `read_data'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:34:in `fetch_path'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:55:in `source_index'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:269:in `source_index'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:400:in `fetch_source'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:391:in `source_index_hash'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:390:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:390:in `source_index_hash'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:370:in `search'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:376:in `execute'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:459:in `execute'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:49:in `invoke'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:90:in `process_args'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:63:in `run'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:9:in `run'
c:/ruby/bin/gem:11
Some investigation seems to indicate that open-uri.rb doesn't support authentication. open-uri is based on Net::HTTP
which *does* support authentication so it should be relatively easy to modify open-uri to do that too. I spent about
an hour on it, but couldn't immediately get something working (open-uri is using Net::HTTP in a somewhat quirky way).
C:/>gem -v
C:/>"c:/ruby/bin/ruby.exe" "c:/ruby/bin/gem" -v
0.8.3
C:/>gem list -p http://proxy:8080 -r --backtrace
C:/>"c:/ruby/bin/ruby.exe" "c:/ruby/bin/gem" list -p http://proxy1.macbank:8080 -r --backtrace
*** REMOTE GEMS ***
Updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (OpenURI::HTTPError)
407 Proxy Authentication Required
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:574:in `proxy_open'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:167:in `open_loop'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:164:in `catch'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:164:in `open_loop'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:134:in `open_uri'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:424:in `open'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb:85:in `open'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:96:in `read_data'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:34:in `fetch_path'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:55:in `source_index'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:269:in `source_index'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:400:in `fetch_source'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:391:in `source_index_hash'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:390:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:390:in `source_index_hash'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:370:in `search'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:376:in `execute'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:459:in `execute'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:49:in `invoke'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:90:in `process_args'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:63:in `run'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:9:in `run'
c:/ruby/bin/gem:11
- gem与代理设置
- gem与代理设置
- ruby gem代理设置
- ruby gem 代理设置
- Ruby gem的proxy代理设置方法
- 使用代理上网时gem设置
- wget与代理设置
- gem 用代理连接方式
- npm gem 代理(转)
- gem 安装与使用
- gem使用代理安装ruby-debug-base19
- ruby与gem基本命令
- gem
- apt代理的设置与取消
- Git代理设置与访问Github
- 代理ip的设置与使用
- Git代理设置与访问Github
- Python 与设置代理的两三事
- php +js 中多选项(复选)框的检测
- Introduction of .NET framework 3.0 (4)
- Introduction of .NET framework 3.0 (5)
- [体育评论]辽沈晚报:神猪罗洗河为什么成了病猪
- wget与代理设置
- gem与代理设置
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake)
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake) - Page 2
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake) - Page 3
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake) - Page 4
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake) - Page 5
- 中国的数学界竟也如此这般
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake) - Page 6
- The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake) - Page 7