我尝试使用命令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)
我该怎么做才能解决这个问题?
答案 0 :(得分:0)
看起来你的来源要么没有正确回应,要么在源头找不到宝石。
试试gem install rack-test
。如果这给你一个错误,请尝试切换你从中获取宝石的来源。
首先添加源代码
gem source -a 'https://production.cf.rubygems.org'
然后再次尝试安装。
或强>
您可以尝试直接从其他来源安装
gem install rack-test --source 'https://production.cf.rubygems.org'
一旦你正确安装了宝石,请尝试再次安装导轨。