windows下安装sass/scss

来源:互联网 发布:网络小时工兼职可靠吗 编辑:程序博客网 时间:2024/05/02 11:10

一、安装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即可。

表达不好请谅解!


0 0
原创粉丝点击