首先是rubyinstaller http://rubyinstaller.org/downloads/shell
有权限直接安装的话,比较省事,不然要找一个压缩包,手动安装。
api
配置环境,例如:
sass
RUBY_HOME=C:\rubyruby
PATH=%RUBY_HOME%\bin服务器
RUBYOPT=-rubygemsui
而后是gemspa
例如:
.net
C:\Users>gem install sass 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)
淘宝的镜像已经无人维护了,参考代理
https://ruby-china.org/topics/29250 code
使用新的镜像
$ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/$ gem sources -l *** CURRENT SOURCES *** https://gems.ruby-china.org# 请确保只有 gems.ruby-china.org$ gem install rails
涉及到代理服务器的话,这么搞:
>>SET http_proxy=>>SET https_proxy= >>gem install something or >>gem list -p http://user:pwd@ip_or_host:8080 -r