Ruby on rails学习笔记——安装环境

出现问题: 
C:Userslen>gem install rails ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ETIMEDOUT: A connection attempt failed because the connected party di d not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) for "rubygems.global. ssl.fastly.net" port 443 (https://api.rubygems.org/quick/Marshal.4.8/sass-3.4.13 .gemspec.rz)

原因是ruby 的gem被和谐了,现在淘宝的ruby工程师架设了rubygems的国内镜像。使用方法如下:

$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***

https://ruby.taobao.org

然后再输入gem install rails,即可安装
Ruby on rails学习笔记——安装环境