当我运行诸如
gem install heroku
或
gem update --system
我收到警告
ERROR: Could not find a valid gem 'heroku' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ECONNREFUSED: No connection could be made because the target machine
actively refused it. - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
我已经浏览了几篇相关的帖子,其中大部分都暗示了网络问题;我关闭了所有的防病毒/防火墙软件,但运气不佳。请注意,同一网络上的其他人没有面临这些问题。我对如何进行感到困惑。
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.2
- RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby1.8.7/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8
- C:/Users/xxxxx/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
最佳答案
旧帖子,但这可能会帮助其他人。指定代理。即使已经设置了http_proxy环境变量,这似乎仍然有效:
gem install heroku --http-proxy http://yourproxyserver:port
关于ruby-on-rails - 安装Ruby Gems,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6172198/