简体   繁体   English

Windows上的“ gem安装导轨”失败

[英]“gem install rails” fails on Windows

I am trying to manually install rails, but have encountered the following error: 我正在尝试手动安装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)

How can this be solved? 如何解决呢?

The steps I followed so far: 到目前为止,我遵循的步骤:

  • I installed Ruby from here: http://rubyinstaller.org/downloads/ , running the Ruby 1.9.3-p545 from the RubyInstaller section. 我从此处安装Ruby: http ://rubyinstaller.org/downloads/,从RubyInstaller部分运行Ruby 1.9.3-p545。 (into C:\\Ruby193) (进入C:\\ Ruby193)
  • I installed also (for use with Ruby 1.8.7 and 1.9.3): the DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe into C:\\RubyDevKit. 我还安装了(与Ruby 1.8.7和1.9.3一起使用):将DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe插入C:\\ RubyDevKit。
  • I went to RubyDevKit in cmd and typed: 我在cmd中进入RubyDevKit并输入:

dir dk.rb 目录dk.rb
ruby dk.rb init 红宝石dk.rb初始化
ruby dk.rb install 红宝石dk.rb安装

  • I launched irb (typed irb in C:\\RubyDevKit) to confirm ruby works and it does. 我启动了irb(在C:\\ RubyDevKit中键入irb)来确认ruby是否正常工作。

I am right now faced with this problem 我现在正面临这个问题

Reset DNS cache solved that problem for me (Run "ipconfig /flushdns" from cmd shell) 重置DNS缓存为我解决了该问题(从cmd shell运行“ ipconfig / flushdns”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM