【问题标题】:Rails ERROR: While executing (Gem::RemoteFetcher::UnknownHostError)Rails 错误:执行时 (Gem::RemoteFetcher::UnknownHostError)
【发布时间】:2013-08-10 04:43:21
【问题描述】:

我尝试使用命令 gem install rails --no-ri --no-rdoc 安装rails,然后出现错误。下面是错误的输出

gem install rails --no-ri --no-rdoc
Fetching: multi_json-1.7.8.gem (100%)
Successfully installed multi_json-1.7.8
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.37
Fetching: atomic-1.1.12.gem (100%)
Building native extensions.  This could take a while...
Successfully installed atomic-1.1.12
Fetching: thread_safe-0.1.2.gem (100%)
Successfully installed thread_safe-0.1.2
Fetching: activesupport-4.0.0.gem (100%)
Successfully installed activesupport-4.0.0
Fetching: builder-3.1.4.gem (100%)
Successfully installed builder-3.1.4
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://rubygems.org/gems/rack-test-0.6.2.gem)

我应该怎么做才能解决这个问题?

【问题讨论】:

  • 从遇到类似的事情(目前还没有解决方案),我怀疑问题是远程提取器没有正确处理重定向(302 Found/Moved Temporarily)。
  • 当我收到类似的错误时,我使用sudo 运行,它成功了。

标签: ruby-on-rails rubygems


【解决方案1】:

您的来源似乎没有正确响应,或者在来源处找不到 gem。

试试gem install rack-test。如果这给您带来错误,请尝试切换您从中获取 gem 的来源。

首先添加源 gem source -a 'https://production.cf.rubygems.org'

然后尝试重新安装。

您可以尝试直接从其他来源安装 gem install rack-test --source 'https://production.cf.rubygems.org'

一旦您正确安装了该 gem,请尝试再次安装 rails。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-07
    相关资源
    最近更新 更多