ruby、gem、haml安装

ruby、gem、haml安装ruby 安装

windows用户,使用RubyInstaller安装,下载地址: 目前Ruby最新版为Ruby 2.2.2(64位系统的安装Ruby 2.2.2(x64))。

安装完成后,打开控制台,输入:

C:\Users\dul>ruby -vruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]

查看Ruby是否安装成功及安装的版本号。

gem安装

gem是个用ruby写的应用程序,用来安装软件包的程序。 Ruby 1.9.2以后的版本默认已安装Ruby Gem。 控制台输入:

C:\Users\dul>gem -v2.4.5

查看gem版本号

haml安装

国内网络环境被墙,会出现连接错误,如下:

C:\Users\dul>gem install hamlERROR: 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 .taobao.org/source .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 hamlFetching: tilt-2.0.1.gem (100%)Successfully installed tilt-2.0.1Fetching: haml-4.0.6.gem (100%)HEADS UP! Haml 4.0 has many improvements, but also has changes that may breakyour 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 gemFor more info see:http://rubydoc.info/github/haml/haml/file/CHANGELOG.mdSuccessfully installed haml-4.0.6Parsing documentation for tilt-2.0.1Installing ri documentation for tilt-2.0.1Parsing documentation for haml-4.0.6Installing ri documentation for haml-4.0.6Done installing documentation gems installed

haml安装成功后,输入:

C:\Users\dul>haml –help

查看haml命令行工具用法

使用haml命令行工具将haml文件编译为html文件E:\workspace\jquery-plugins\examples>haml test.html.haml test.html

haml学习地址:

只剩下一条路,那就是成功的路。

ruby、gem、haml安装

相关文章:

你感兴趣的文章:

标签云: