ubuntu安装ruby,安装sass,安装compass
安装ruby
apt-get install ruby
apt-get install ruby-dev
也可以安装指定的版本
# sudo apt-get install python-software-properties
# sudo apt-add-repository ppa:brightbox/ruby-ng
# sudo apt-get update
# sudo apt-get install ruby2.5 ruby2.5-dev
可以通过。
ruby -v
查看版本。
安装sass
sass依赖ruby,而且版本要2.0及以上。
sudo gem install sass
jiqing@ThinkPad:~$ sudo gem install sass
Fetching: rb-fsevent-0.10.3.gem (100%)
Successfully installed rb-fsevent-0.10.3
Fetching: ffi-1.9.23.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.23
Fetching: rb-inotify-0.9.10.gem (100%)
Successfully installed rb-inotify-0.9.10
Fetching: sass-listen-4.0.0.gem (100%)
Successfully installed sass-listen-4.0.0
Fetching: sass-3.5.6.gem (100%)
Successfully installed sass-3.5.6
Parsing documentation for rb-fsevent-0.10.3
Installing ri documentation for rb-fsevent-0.10.3
Parsing documentation for ffi-1.9.23
Installing ri documentation for ffi-1.9.23
Parsing documentation for rb-inotify-0.9.10
Installing ri documentation for rb-inotify-0.9.10
Parsing documentation for sass-listen-4.0.0
Installing ri documentation for sass-listen-4.0.0
Parsing documentation for sass-3.5.6
Installing ri documentation for sass-3.5.6
Done installing documentation for rb-fsevent, ffi, rb-inotify, sass-listen, sass after 14 seconds
5 gems installed
安装成功。
jiqing@ThinkPad:~$ sass -v
Ruby Sass 3.5.6
测试使用
sass main.scss main.css
它会生成一个main.css的文件。
安装compass
sudo gem install compass
jiqing@ThinkPad:~$ sudo gem install compass
[sudo] password for jiqing:
Fetching: sass-3.4.25.gem (100%)
Successfully installed sass-3.4.25
Fetching: multi_json-1.13.1.gem (100%)
Successfully installed multi_json-1.13.1
Fetching: compass-core-1.0.3.gem (100%)
Successfully installed compass-core-1.0.3
Fetching: compass-import-once-1.0.5.gem (100%)
Successfully installed compass-import-once-1.0.5
Fetching: chunky_png-1.3.10.gem (100%)
Successfully installed chunky_png-1.3.10
Fetching: compass-1.0.3.gem (100%)
Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.3
Parsing documentation for sass-3.4.25
Installing ri documentation for sass-3.4.25
Parsing documentation for multi_json-1.13.1
Installing ri documentation for multi_json-1.13.1
Parsing documentation for compass-core-1.0.3
Installing ri documentation for compass-core-1.0.3
Parsing documentation for compass-import-once-1.0.5
Installing ri documentation for compass-import-once-1.0.5
Parsing documentation for chunky_png-1.3.10
Installing ri documentation for chunky_png-1.3.10
Parsing documentation for compass-1.0.3
Installing ri documentation for compass-1.0.3
Done installing documentation for sass, multi_json, compass-core, compass-import-once, chunky_png, compass after 5 seconds
6 gems installed
jiqing@ThinkPad:~$ compass -v
Compass 1.0.3 (Polaris)
Copyright (c) 2008-2018 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass