Sass and Compass alpha releases have the ability to generate sourcemaps, thus making them very appealing.
Maybe you also want to see my followup post: How to enable sourcemaps in Sass and Compass.
We'll be using:
$ means that it's a command written in terminal)
You can also use the the Ruby that is backed into your OS X, but it's more safe to use the RVM and leave the System Ruby alone.
Btw: If you want to use a custom Sass or Compass compiler in CodeKit, you need to use the system Ruby to do that, RVM Ruby is no good for CodeKit (at least in the >2 versions).
This'll give you the version you're running:
$ rvm use # It might return something like Using /Users/bob/.rvm/gems/ruby-1.9.2-p484
If you have 1.9.3 or higher you're good for running Sass 3.3.0.rc.3 and Compass 1.0.0.alpha.18, and can skip the Upgrade Ruby section here. If you have 1.9.2 or lower, see upgrade instructions below.
Run these from Terminal one at a time:
$ rvm get stable $ rvm reload $ rvm list known
rvm list known command will spew out a bunch of text, you're interested in the
# MRI Rubies:
# MRI Rubies ... [ruby-]1.9.3[-p484] ...
$ rvm install 1.9.3 # Or whatever the version it is you wanna install
The installation proses starts, it'll take some time.
You'll find the newly installed Ruby at
To switch to it:
$ rvm use ruby-1.9.3-p484
To check what Ruby you're using:
$ rvm use
If you're getting errors like this:
configure: error: C compiler cannot create executables See `config.log' for more details There has been an error while running configure. Halting the installation.
You might face this especially if you're using Mavericks.
If that won't help, go to Terminal and run:
$ xcode-select --install
Now that you got the proper Ruby version up and running you can install Sass and Compass, see the Sass gem page for the latest verion.
# This gets the latest pre release # At the time of writing it's 3.3.0.rc.3 $ gem install sass --pre
When the stable 3.3 is out, you want to use it rather than the alpha. Just skip the
--pre from it:
gem install sass.
Get Compass alpha, see the Compass gem page for the latest version.
# This get the latest pre release # At the time of writing it would be 1.0.0.alpha.18 $ gem install compass --pre
If you get errors, you might have an old Ruby version, see the Upgrade Ruby above.
What if you need the old Compass on some project? Cause the project uses Compass plugin that is not compatible with the new Compass version (or something). Fret not, you can use different gemsets for different projects. See RVM docs on it.
$ rvm 1.9.3-head $ rvm gemset create mygemset Gemset 'mygemset' created.
$ rvm ruby-1.9.2-p320@mygemset
To automatically define the right gemset per project basis, you just put a file called
.rvmrc into the root of the project that has that command in it. An example
rvm use ruby-1.9.3-p484
See my followup post on how to enable sourcemaps in Sass and Compass.
Comments would go here, but the commenting system isn’t ready yet, sorry. Tweet me @hiljaa if you want to make a correction etc.