Appendix A. Installing Sass and Compass

published book

Both Sass and Compass are command-line tools built on top of the Ruby programming language. To use them you’ll need to have Ruby installed as well as a basic understanding of your computer’s command line. Sass and Compass can be installed on Windows, Mac OS X, and Linux.

join today to enjoy all our content. all the time.
 

A.1. Installation on Windows

Windows doesn’t come with Ruby, so unless you have previously installed it, you’ll need to do so now. It only takes a few minutes.

A.1.1. Opening the Windows command prompt

On Windows 7, you can launch the command prompt from the Windows start menu by selecting All Programs > Accessories > Command Prompt. Alternately, you can type command into the search box and then select Command Prompt from the results.

On earlier versions of Windows, you can launch the command prompt by selecting All Properties > Accessories > Command Prompt. Alternatively, you can select Run and then enter cmd and press Return.

When the command prompt is running, you should see a window like figure A.1.

Figure A.1. Windows command prompt

A.1.2. Installing Ruby on Windows

From the command prompt, type ruby -v and then press Return. If Ruby isn’t installed, the command prompt will tell you 'ruby' is not recognized as an internal or external command, operable program or batch file. If Ruby is installed, it’ll print out the version of Ruby you have installed. The version should be greater than or equal to 1.8.7 (if 1.8.6 or below, please install Ruby with the following instructions).

Figure A.2. Downloading the Ruby installer

Go to http://rubyinstaller.org/downloads/. Click on the most recent Ruby version and click Run. Walk through the guided installer’s steps. When you get to the third screen, it’ll ask you where to install Ruby; check the two check boxes before continuing.

Figure A.3. Configuring the Ruby installer

Now close your command prompt and launch it again, and verify that Ruby is installed by typing ruby -v and pressing Return.

Figure A.4. Ruby installed

A.1.3. Installing Sass and Compass on Windows

Ruby comes with a system for installing Ruby-based software called RubyGems. Both Sass and Compass can be easily installed using this system. To install the latest version of Sass:

$ gem install sass
$ gem install compass

In each case, you should see output that looks like this:

Successfully installed sass-3.1.0
1 gem installed
Installing ri documentation for sass-3.1.0...
Installing RDoc documentation for sass-3.1.0...

After installing, you should verify that the applications are installed correctly by running the following commands:

$ sass -v
Sass 3.1.0 (XXX NAME ME)

$ compass -v
Compass 0.11.0
Copyright (c) 2008-2011 Chris Eppstein
Released under the MIT License.
Get Sass and Compass in Action
add to cart

A.2. Installation on Mac OS X

Mac OS X has come with Ruby installed by default for some time now, so it’s likely that you don’t need to install Ruby.

A.2.1. Opening the Mac OS X Terminal

Figure A.5. Launching the Mac OS X Terminal

You can launch the terminal application from the Finder by going into Applications > Utilities and double-clicking the Terminal application.

If you’re unfamiliar with the Mac OS X Terminal, we recommend that you read the Terminal tutorial written by John Long, which can be found at http://wiseheartdesign.com/articles/2010/11/12/the-designers-guide-to-the-osx-command-prompt/.

A.2.2. Installing Ruby

From the command prompt, type ruby -v and then press Return. If Ruby isn’t installed, the command prompt will tell you bash: ruby: command not found. In this unlikely scenario, please follow the instructions for installation found at http://rubyosx.rubyforge.org/. Be sure to restart the Terminal after installing.

A.2.3. Installing Sass and Compass on Mac

Ruby comes with a system for installing Ruby-based software called RubyGems. Both Sass and Compass can be easily installed using this system. To install the latest version of Sass and Compass:

$ sudo gem install sass
$ sudo gem install compass

In each case, you should see output that looks like this:

Successfully installed sass-3.1.0
1 gem installed
Installing ri documentation for sass-3.1.0...
Installing RDoc documentation for sass-3.1.0...

After installing, you should verify that the applications are installed correctly by running the following commands:

$ sass -v
Sass 3.1.0 (XXX NAME ME)

$ compass -v
Compass 0.11.0
Copyright (c) 2008-2011 Chris Eppstein
Released under the MIT License.
Sign in for more free preview time

A.3. Installation on Linux

Please follow your Linux distribution’s instructions for installing Ruby if it’s not installed.

A.3.1. Opening the Linux Terminal

It’s assumed that as a Linux user you know how to access your terminal.

A.3.2. Installing Ruby

If Ruby isn’t installed, install it using your Linux distribution’s software installation mechanism.

A.3.3. Installing Sass and Compass on Linux

Ruby comes with a system for installing Ruby-based software called RubyGems. Both Sass and Compass can be easily installed using this system. To install the latest version of Sass:

$ sudo gem install sass
$ sudo gem install compass

In each case, you should see output that looks like this:

Successfully installed sass-3.1.0
1 gem installed
Installing ri documentation for sass-3.1.0...
Installing RDoc documentation for sass-3.1.0...

After installing, you should verify that the applications are installed correctly by running the following commands:

$ sass -v
Sass 3.1.0 (XXX NAME ME)

$ compass -v
Compass 0.11.0
Copyright (c) 2008-2011 Chris Eppstein
Released under the MIT License.
sitemap
×

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
{{{UNSCRAMBLE_INFO_CONTENT}}}