本文主要是介绍sass安装与webstorm配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
sass安装
sass 是一种 CSS 的开发工具,提供了许多便利的写法,大大节省了设计者的时间,使得 CSS 的开发,变得简单和可维护。
Sass 需使用rubygems 安装,而因为国内网络原因 rubygems 会连接失败,我们可以使用 ruby.taobao.org 提供的镜像安装 Sass。
mac
mac自带 Ruby无需安装,可在终端输入ruby -v
查看版本号
ruby -vruby 2.1.5p273 (2014-11-13 revision 48405) [x64-mingw32]
如果已经翻墙,终端输入
gem install sass
若在墙里,切换 gem 源至 taobao 并安装 Sass
在命令行依次输入
gem sources --remove https://rubygems.org/https://rubygems.org/ removed from sourcesgem sources -a https://ruby.taobao.org/https://ruby.taobao.org/ added to sourcesgem source -l*** CURRENT SOURCES ***https://ruby.taobao.org/gem install sassFetching: sass-3.4.13.gem (100%)Successfully installed sass-3.4.13Parsing documentation for sass-3.4.13Installing ri documentation for sass-3.4.13Done installing documentation for sass after 12 seconds1 gem installed
如果安装时出现如下提示
ERROR: While executing gem ... (Gem::FilePermissionError)You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
则切换root权限安装
sudo gem install sass
如果你在安装时出现如下提示,则表明网络不佳或源没有切换
到 ruby.taobao.org
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://api.rubygems.org/latest_specs.4.8.gz)
webstorm下给scss文件添加watch
查看sass的安装路径
which sass
设置webstorm
新建一个scss文件,可以看到对应生成了css
这篇关于sass安装与webstorm配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!