Take the Pain Out of Sass

Ian Carrico

Why is it hard?

  • Ruby has many versions, with small changes
  • Rubygems can be updated, changed, etc. VERY frequently

Why is this hard?

  • Mac / System ruby
  • Different ruby / gems per-project

Simple things first!

echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc

rbenv

Why would I not use system ruby?

If you need different versions of ruby.

Beware!

The next version of OS X will have Ruby 2.0.0-p247

What does it do?

  • Allow different versions of ruby
  • Put the ruby installation into your user directory

Installation requires homebrew

So... install that

Installation

brew install rbenv ruby-build

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

Install a version of ruby

rbenv install 2.0.0-p247

rbenv rehash

rbenv global 2.0.0-p247

.ruby-version

If you weren't paying attention because you don't need rbenv, come back now!

.ruby-version

Put a file at the root of ALL your projects called ".ruby-version"

  • 1.8.7-p358
  • 2.0.0-p247

.ruby-version

rbenv local 2.0.0-p247

Bundler

Manages your gem versions

Just a ruby gem

{sudo} gem install bundler

Bundler is now ready to use!

Gemfile / Gemfile.lock

The latter is made after running bundle install

Configuration (optional)

mkdir ~/.bundle

echo 'BUNDLE_PATH: vendor/bundle' >> ~/.bundle/config

bundle install

sudo bundle install

DON'T DO THIS

bundle exec {{command}}

bundle exec compass compile

Grunt.js

Have grunt.js compile your Sass AND MORE!

What can it do?

  • Livereload
  • Image minification
  • JavaScript linting
  • JavaScript minification
  • Jekyll integration
  • ... etc.
Four Kitchens