【发布时间】:2014-09-27 09:55:11
【问题描述】:
新手在这里。希望你能帮我解决这个问题。
rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install railsYou can then rerun your "rails" command.
KrisOrqla:~ Kris$ sudo gem install rails
Password:
Failed to load /Users/Kris/.gemrc because it doesn't contain valid YAML hash
Fetching: minitest-5.4.2.gem (100%)
Successfully installed minitest-5.4.2
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: i18n-0.6.11.gem (100%)
Successfully installed i18n-0.6.11
Fetching: activesupport-4.1.6.gem (100%)
Successfully installed activesupport-4.1.6
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: actionview-4.1.6.gem (100%)
Successfully installed actionview-4.1.6
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: rack-test-0.6.2.gem (100%)
Successfully installed rack-test-0.6.2
Fetching: actionpack-4.1.6.gem (100%)
Successfully installed actionpack-4.1.6
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://api.rubygems.org/gems/tilt-1.4.1.gem) ( ITS SAYS ERROR)
我再次输入 rails -v 但问题出现了!
谢谢
【问题讨论】:
-
我试过了,但是一直没用。 (无法加载 /Users/Kris/.gemrc,因为它不包含有效的 YAML 哈希 错误:执行 gem 时 ... (Gem::RemoteFetcher::UnknownHostError) 没有这样的名称(api.rubygems.org/gems/tilt-2.0.1.gem).Error 似乎是关于有效的YAML 哈希。这是怎么回事?谢谢
标签: ruby-on-rails ruby ruby-on-rails-3 gem rubygems