您的位置:首页 > Web前端 > CSS

windows下安装sass/scss

2015-08-12 13:25 701 查看
转载自:http://www.th7.cn/Program/Ruby/201502/388940.shtml

一、安装ruby。到ruby官网下载最新的ruby软件,然后开始安装ruby,最好放到系统下,安装时勾选添加环境变量的路径,如下图:



二、安装sass。打开命令窗口,输入如下命令gem install sass,这时可能会报这样的错误,

ERROR: Could not find a valid gem 'sass' (>= 0) in any repository

ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)

Errno::ETIMEDOUT: A connection attempt failed because the connected party di

d not properly respond after a period of time, or established connection failed

because connected host has failed to respond. - connect(2) (http://rubygems.org/

latest_specs.4.8.gz),这个错误是路径被墙掉了,可以加上一个国内的库,在命令窗口中输入如下命令:

gem sources -a http://ruby.taobao.org回车,然后再输入gem install sass安装sass即可

三、安装compass。输入命令gem
install compass,这时可能会报这样的错误

The 'ffi' native gem requires installed build tools.

Please update your PATH to include build
tools
or download the DevKit

from 'http://rubyinstaller.org/downloads' and follow the instructions

at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

这就下载安装devkit了,到ruby官网下载devkit,解压到C:/DevKit下,
C:/DevKit>ruby dk.rb init

[INFO] found RubyInstaller v1.9.3 at C:/Ruby193

Initialization complete! Please review and modify the auto-ge

'config.yml' file to ensure it contains the root directories

of the installed Rubies you want enhanced by the DevKit.

 

C:/DevKit>ruby dk.rb install

[INFO] Updating convenience notice gem override for 'C:/Ruby1

[INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'

 

C:/DevKit>gem install rdiscount --platform=ruby

Fetching: rdiscount-1.6.8.gem (100%)

Temporarily enhancing PATH to include DevKit...

Building native extensions.  This could take a while...

Successfully installed rdiscount-1.6.8

1 gem installed

Installing ri documentation for rdiscount-1.6.8...

Installing RDoc documentation for rdiscount-1.6.8...

OK!再次gem install compass即可。

表达不好请谅解!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ruby sass