ruby 安装windows用户,使用RubyInstaller安装,下载地址: http://rubyinstaller.org/downloads/ 
目前Ruby最新版为Ruby 2.2.2(64位系统的安装Ruby 2.2.2(x64))。
安装完成后,打开控制台,输入:
C:\Users\dul>ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]查看Ruby是否安装成功及安装的版本号。
gem安装gem是个用ruby写的应用程序,用来安装软件包的程序。 
Ruby 1.9.2以后的版本默认已安装Ruby Gem。 
控制台输入:
C:\Users\dul>gem -v
2.4.5查看gem版本号
haml安装国内网络环境被墙,会出现连接错误,如下:
C:\Users\dul>gem install haml
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNABORTED: An established connection was aborted by the software in your host machine. - SSL_connect (https://api.rubygems.org
/quick/Marshal.4.8/haml-4.0.6.gemspec.rz)淘宝提供了淘宝提供了RubyGems的国内镜像站点,解决办法是:
C:\Users\dul>gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sourcesC:\Users\dul>gem sources -a http://ruby.taobao.org/
source http://ruby.taobao.org/ already present in the cacheC:\Users\dul>gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org/请确保只有 ruby.taobao.org
C:\Users\dul>gem install haml
Fetching: tilt-2.0.1.gem (100%)
Successfully installed tilt-2.0.1
Fetching: haml-4.0.6.gem (100%)
HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:
* Support for Ruby 1.8.6 dropped
* Support for Rails 2 dropped
* Sass filter now always outputs <style> tags
* Data attributes are now hyphenated, not underscored
* html2haml utility moved to the html2haml gem
* Textile and Maruku filters moved to the haml-contrib gem
For more info see:
http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
Successfully installed haml-4.0.6
Parsing documentation for tilt-2.0.1
Installing ri documentation for tilt-2.0.1
Parsing documentation for haml-4.0.6
Installing ri documentation for haml-4.0.6
Done installing documentation for tilt, haml after 3 seconds
2 gems installedhaml安装成功后,输入:
C:\Users\dul>haml --help查看haml命令行工具用法
haml命令行工具将haml文件编译为html文件E:\workspace\jquery-plugins\examples>haml test.html.haml test.html原文地址:http://blog.csdn.net/sspeed5cm/article/details/45587307