Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Monday, May 16, 2011

Install Compass and Sass in Ubuntu 11.04

Here is a tutorial on setting up your environment to use compass and sass in Ubuntu 11.04 ( should be the same as previous version )

1) Install Ruby
sudo apt-get install ruby-full

2) Install Gem
sudo apt-get install rubygems1.8

3) Install Rails, sqlite3 ( optional, but usually I install that as well )
sudo gem install rails
sudo gem install sqlite3

Try to run this to make your system up-to-date
sudo gem update --system  

4) Install Compass
sudo gem install compass

5) Install Sass
sudo gem install sass

6) Create your first project
(If you want to use normal css syntax, scss)
compass create <myproject>

(If you want to use sass syntax)
compass create <myproject> --syntax sass

How to create your first project
  1. cd /path/to/projects_folder
  2. compass create my_test_project
  3. compass watch my_test_project
Now you can open your favorite IDE, and look into the just created "my_test_project".  You will see a bunch of files are created.  By default, the "sass" folder is the place for holding the sass files, while the "stylesheets" folder is the place for the generated css files.  And you can configure those by changing the  "config.rb" if you will.

Some "extensions" that you may want to install after you setup your project
  • (CSS3 PIE)  compass install  compass/pie

Some "gems" you may be interested 

For more information on Compass and Sass, please visit the official documentation - http://compass-style.org/install/ and http://sass-lang.com/.