back home

Compass Style error on OSX Yosemite

December 5, 2014

After update my OSX maverick to OSX Yosemite, I got an error while running
compass watch

-bash: /usr/bin/compass: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

This happened because OSX Yosemite already update its Ruby with the latest Ruby version to 2.0 and Compass failed to read a file/directory on previous version (1.8)

So, what we need to do :

1. Update Xcode Command Line Tool

sudo xcode-select --install


A Box will appear and asking you to continue next step.

2. Update gem

Make sure that gem is the latest version

sudo gem update --system

3. Uninstall current SASS & Compass

Remove all current SASS & Compass files, we’ll install version that match with OSX Yosemite

sudo gem uninstall compass
sudo gem uninstall sass

4. Install SASS (ver. 3.3.7) & Compass (ver. 0.12.6)

I try a few version and this is the best version running on OSX Yosemite

sudo gem install sass -v 3.3.7
sudo gem install compass -v 0.12.6

After latest version of xcode updated, close terminal and try to compass watch on your working directory.