Switching Between Compass Versions

Pablo Vallejo

Pablo Vallejo

Jul 10, 2014

1 min read.

Compass is a great framework that helps us writing clean styles using Sass, creating sprites, using mixins and among other features it makes it easy to author Websites.

One of the problems we had when using it, was that as we have several Django projects we're very used to have different version of dependencies for each project using VirtualEnvWrapper, therefore,
we wanted to as well have multiple versions of compass and switch them in a per project basis.

So, after reading a little and browsing for answers on StackOverflow we found that having multiple compass versions was pretty easy as we could install the versions we needed and pass the desired one as a parameter to the compass command.

That sounds nice, show me the code! so here's how we go about it.

Install all the compass versions you want to use

# Install the latest version
gem install compass

# Install 0.10.5
gem install compass -v 0.10.5

# Install 0.12.6
gem install compass -v 0.12.6

Once in a project, if we want to compile the styles using compass 0.10.5 we would type:

compass _0.10.5_ compile app/static

And the same goes for another project that uses the version 0.12.6 of compass

compass _0.12.6_ compile app/static

This option also works for the watch command.

compass _0.12.6_ watch app/static

And after doing this, we were able to use a different version of compass depending on the project we were working on.


Happy Styling!

Get in the loop and learn more about building digital products:

Dependency Management In Django Using Bower

In today's web applications it's very common to use libraries and have several dependencies that are used in the front end of...

Pablo Vallejo

Pablo Vallejo

OSX infinite login issue

OSX is a Linux cousin, if you know about the command line, you can fix problems, your system shouldn't be a black box. &nbsp...

Igor Támara

Igor Támara

Django: How to send request to JSON view in tests

If in your Django project you have a view that accepts or returns JSON, you can use the following code for your unittests

Vera Mazhuga

Vera Mazhuga

We build software solutions for business from idea to launch.

Let's Talk