【问题标题】:"gem install rails" fails on Windows“gem install rails”在 Windows 上失败
【发布时间】:2014-04-08 21:55:28
【问题描述】:

我正在尝试手动安装rails,但遇到以下错误:

c:\Ruby193\bin>gem install rails
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: A connection attempt failed because the connected party 
did not properly respond after a period of time, or established connection failed
because connected host has failed to respond. - connect(2) (http://rubygems.org/
latest_specs.4.8.gz)

如何解决?

到目前为止我遵循的步骤:

  • 我从这里安装了 Ruby:http://rubyinstaller.org/downloads/, 从 RubyInstaller 部分运行 Ruby 1.9.3-p545。 (进入 C:\Ruby193)
  • 我还安装了(用于 Ruby 1.8.7 和 1.9.3): DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe 进入 C:\RubyDevKit。
  • 我在cmd中转到RubyDevKit并输入:

目录 dk.rb
ruby dk.rb 初始化
ruby dk.rb 安装

  • 我启动了 irb(在 C:\RubyDevKit 中输入了 irb)来确认 ruby 确实有效。

【问题讨论】:

  • 嗯,你连接到互联网了吗?
  • 是的,我已连接到互联网,mu。事实上,我现在只是尝试通过在浏览器中输入这个来手动下载http://rubygems.org/ latest_specs.4.8.gz 并且它有效。但是,如上所述,当我输入 gem install rails 时,我的 Rails 安装仍然失败。有什么我想念的吗?需要安装导轨。
  • 看看这个question

标签: ruby-on-rails ruby


【解决方案1】:

我现在面临这个问题

重置 DNS 缓存为我解决了这个问题 (从 cmd shell 运行“ipconfig /flushdns”)

【讨论】:

    猜你喜欢
    • 2020-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多