如何在Ruby for Windows中更新gem?

Jun*_*r M 7 ruby rubygems

我正在使用Ruby的命令提示符.我无法安装任何更新,但互联网导航似乎工作.

我这里没有代理人.

C:\Windows\System32>gem update activesupport
Updating installed gems
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/latest_specs.4.8.gz)
Run Code Online (Sandbox Code Playgroud)

可能有什么不对?

这是我的环境:

C:\Ruby\bin>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.6.2
  - RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby/lib/ruby/gems/1.9.1
     - C:/Users/wmj/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
Run Code Online (Sandbox Code Playgroud)

Gar*_*eve 16

首次运行(具有管理员权限):

gem update --system
Run Code Online (Sandbox Code Playgroud)

然后运行activesupport的更新.我有一次该错误,因为我在代理后面,在这种情况下,放:

gem update --http-proxy http://web.proxy.uri --system 
Run Code Online (Sandbox Code Playgroud)