ruby、gem、haml安装
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 sources
C:\Users\dul>gem sources -a http://ruby.taobao.org/
source http://ruby.taobao.org/ already present in the cache
C:\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 installed
haml
安装成功后,输入:
C:\Users\dul>haml --help
查看haml
命令行工具用法
- 使用
haml
命令行工具将haml
文件编译为html
文件
E:\workspace\jquery-plugins\examples>haml test.html.haml test.html
haml
学习地址:
http://haml.info/docs/yardoc/file.REFERENCE.html
时间: 2024-10-07 04:17:35