Install Ruby, Sass and Compass


Sass is a CSS preprocessor which adds nested rules, mixins, variables, selectors and more. Sass generates well formatted CSS and makes your stylesheets easier to organize and maintain. Compass is a framework build on the top of the Sass and it makes working with Sass even easier. Both Compass and Sass are Ruby gems so you’ll need to have Ruby on your linux vps

.

RVM (Ruby Version Manager) can handle the installation and management of multiple Ruby environments.

Install dependencies

Debian based distributions ( Debian VPS  / Ubuntu VPS )

apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

Red Hat based distributions ( Centos VPS / Fedora VPS / Scientific Linux VPS )

yum install gcc-c++ patch readline readline-devel curl zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

Arch Linux ( Arch-Linux VPS )

pacman -Sy --noconfirm gcc patch curl zlib readline libxml2 libxslt git autoconf automake diffutils make libtool bison subversion

Install RVM

curl -L https://get.rvm.io | bash -s stable --ruby

Add the following code to ‘/etc/profile’, log out and then log back in.

if [ -s "/usr/local/rvm/scripts/rvm" ] ; then
 . "/usr/local/rvm/scripts/rvm"
 fi

Install Ruby 1.9.3

rvm install 1.9.3
rvm use 1.9.3
rvm rubygems latest

Run ruby –version to verify.

#-> ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

Install Compass

gem update --system
gem install compass

You will get output similar to the following

#-> gem install compass
 Fetching: sass-3.2.1.gem (100%)
 Fetching: chunky_png-1.2.6.gem (100%)
 Fetching: fssm-0.2.9.gem (100%)
 Fetching: compass-0.12.2.gem (100%)
 Successfully installed sass-3.2.1
 Successfully installed chunky_png-1.2.6
 Successfully installed fssm-0.2.9
 Successfully installed compass-0.12.2
 4 gems installed
 Installing ri documentation for sass-3.2.1...
 Installing ri documentation for chunky_png-1.2.6...
 Installing ri documentation for fssm-0.2.9...
 Installing ri documentation for compass-0.12.2...
 Installing RDoc documentation for sass-3.2.1...
 Installing RDoc documentation for chunky_png-1.2.6...
 Installing RDoc documentation for fssm-0.2.9...
 Installing RDoc documentation for compass-0.12.2...

Create your first project

cd /path/to/projects_directory
compass create my_project

What should you read next?

http://sass-lang.com/docs.html
http://compass-style.org/reference/compass/

 

Tutorials
Install PrestaShop on a CentOS VPS
Tutorials
Speed-up your PHP based websites using Zend Optimizer on a CentOS 6 VPS
Tutorials
How to install and integrate SpamAssassin with Postfix on a CentOS 6 VPS
  • Jeroen

    JeroenJeroen

    Author Reply

    Where do i have to put:

    if [ -s “/usr/local/rvm/scripts/rvm” ] ; then
    . “/usr/local/rvm/scripts/rvm”
    fi

    ???

    At the end of the file?


    • admin

      adminadmin

      Author Reply

      Yes, add the lines at the end of the file.