码迷,mamicode.com
首页 > 其他好文 > 详细

ruby、gem、haml安装

时间:2015-05-09 08:54:57      阅读:439      评论:0      收藏:0      [点我收藏+]

标签:ruby   gem   haml   安装   

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

ruby、gem、haml安装

标签:ruby   gem   haml   安装   

原文地址:http://blog.csdn.net/sspeed5cm/article/details/45587307

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!