博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
安装 ruby, sass 和 compass
阅读量:6946 次
发布时间:2019-06-27

本文共 2146 字,大约阅读时间需要 7 分钟。

  hot3.png

sass 是一个 css 的预处理器, 简写css, 以及CSS的导航, sass 基于 ruby, 需要先安装 ruby 然后在安装 sass

安装 Ruby

目的是 安装 sass, 可以快速的访问本地源

安装

windows

使用 rubyinstall 安装 ruby
官方网站:

mac

自带

centos

$ yum install ruby

ubuntu

$ apt-get install ruby

更换 ruby 源

参见

$ gem sources --remove https://rubygems.org/$ gem sources -a https://gems.ruby-china.org/$ gem sources -l

安装 sass

安装

$ gem install sass

测试运行编译

$ sass test.scss test.css  --style   #  nested:嵌套缩进的css代码,它是默认值   #  expanded:没有缩进的、扩展的css代码。   #  compact:简洁格式的css代码。   #  compressed:压缩后的css代码。# watch a file$ sass --watch input.scss:output.css# watch a directory$ sass --watch ap/some:some/name

安装compass

$ gem install compass

创建项目

$ compass create my-project$ cd my-project$ compass watch

常见错误

创建 compass 项目报错

$ compass create my-project

“Errno::EACCES on line [”897“] of C: Permission denied”

LoadError on line ["55"] of D: cannot load such file -- compass/import-once/activate

解决方法

// uninstall $ gem uninstall sass$ gem uninstall compass// install pre version$ gem install compass --pre$ gem install sass --pre

使用 compass 监控项目变动

$ compass watch

LoadError on line ["55"] of D: cannot load such file -- wdm

解决方法

安装 wdm

$ gem install wdm

安装 wdm 出错

ERROR: Error installing wdm: The 'wdm' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from '' and follow the instructions
at ''

下载 devKit 包 然后根据 上边给出的地址进行 devKit的安装

重新安装 wdm

Temporarily enhancing PATH to include DevKit...

Building native extensions. This could take a while...
Successfully installed wdm-0.1.0
Parsing documentation for wdm-0.1.0
unable to convert "\x90" from ASCII-8BIT to UTF-8 for ../../extensions/x64-mingw
32/2.0.0/wdm-0.1.0/wdm_ext.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/wdm_ext.so, skipping
1 gem installed

后记,先按照一般的方法安装,在一般方法出错情况下再安装以上的方法 例如 --pre

sass @import “compass/reset” error

use compass watch instead of sass --watch sass:stylesheets. If you're using compass, you don't need to bother with sass command. Just use the compass command.

这里说的是你如果使用compass 就不要是用 sass 命令来监控文件的变动了

变更记录

  • 2015年11月27日 更换为 淘宝https 源

转载于:https://my.oschina.net/duoli/blog/1635534

你可能感兴趣的文章
android 手机 应用程序版本号 和操作系统版本号
查看>>
Java线程:概念与原理
查看>>
&nbsp|&quot|&amp|&lt|&gt等html字符转义
查看>>
javascript-在HTML中引入js
查看>>
VLAN基础
查看>>
JVM系列一:JVM内存组成及分配
查看>>
mysqldump导入导出mysql数据库
查看>>
搜狗五笔输入法:“分号模式”(中文下快速输入英文的另类方法)
查看>>
Mac 下安装使用 Love2D
查看>>
史上最全的机器学习资料(下)
查看>>
#SORA#celery原生配置文件研究
查看>>
python 详解re模块
查看>>
程序员之路——一个老程序员对刚上大学的学弟学妹的忠告
查看>>
oninput & onpropertychange 实现监听input的键盘事件
查看>>
famous
查看>>
PHP加密扩展 (php-beast) 1.5版本 常见问题解答
查看>>
C++ primer(笔记更新中)
查看>>
CNPM搭建私有的NPM服务
查看>>
centos6网卡自动启动设置
查看>>
Python各种流程语句
查看>>