去以下网站下载、安装rubyinstaller+DevKit
http://rubyinstaller.org/downloads/
输入以下命令更换下载源:
C:\Ruby21-x64\bin>gem sources --remove https://rubygems.org/https://rubygems.org/ removed from sources
C:\Ruby21-x64\bin>gem sources -a https://ruby.taobao.org/
https://ruby.taobao.org/ added to sources
C:\Ruby21-x64\bin>gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
因为rails 4.2里的activerecord-sqlserver-adapter 4.2不支持sqlserver 2005、2008、2008R2,所以安装rails 4.1.9
C:\Ruby21-x64\bin>gem install rails -v 4.1.9
安装DevKit,解压t到一个固定目录,例如:C:\Ruby21-x64\DevKit,然后执行以下命令
C:
CD C:\Ruby21-x64\DevKit
ruby dk.rb init
ruby dk.rb install
创建第一个WEB程序
cd projects_dir
rails _4.1.9_ new test_app -B -d sqlserver
cd test_app
修改Gemfile文件
将第1行的:source 'https://rubygems.org' 改为: source 'https://ruby.taobao.org'
找到tzinfo-data这一行,平台增加一个 改为x64_mingw,即改为: gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
加入一行:gem 'tiny_tds'
保存退出后,执行:
bundle update