Tags

Follow the instructions at http://cygwin.com/install.html. You will run an executable called setup.exe which will guide you through the installation. You will eventually arrive at a screen where you can select the packages you want to install. Be sure to install Ruby (its under Interpreters/ruby).

Once Cygwin has finished installing packages, it will offer to create icons for you. You can click on these icons to start up a terminal session, so select what ever is convenient for you.

Once installation is complete, start a terminal session.

Confirm that ruby is installed by typing this at the prompt:

ruby -v

You should see something like this come back:

ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]

Install RubyGems

A lot of Ruby software, including SASS and Compass, are distributed using the package manager "RubyGems". You need to install RubyGems. The instructions at http://old.stevenharman.net/blog/archive/2008/11/12/installing-rubygems-in-cygwin.aspx [Copied immediately below] have worked for me.

The How-To

Don't try to install RubyGems for Cygwin using the gem that comes with the Ruby One-Click Installer for Windows. Instead, get the tarball, or zip file, and install it using the included installer script.

Since RubyGems is pure Ruby you don't have to worry about having a compiler installed. It should just work with the default Cygwin install plus Ruby and its dependencies. To install it, do the following steps:

  1. Download the RubyGems tarball from Ruby Forge
  2. Unpack the tarball
  3. In a bash terminal, navigate to the unpacked directory
  4. Run the following command: ruby setup.rb install
  5. Update RubyGems by running the following: gem update --system

Note: You may need to run the updated command twice if you have any previously installed gems.

Gem update fails at this point because the path is not correct!

Run the following:

1. alias ruby='C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe'

2.alias rails='C:/RailsInstaller/Ruby1.8.7/bin/rails'

3.alias gem='C:/RailsInstaller/Ruby1.8.7/bin/gem'

I followed these instructions: http://www.techques.com/question/1-9673477/Error-Dealing-with-Rails-in-Aptana I had to change the back slashes to forward slashes to make it work though.

Now run gem update --system

gem -v

You should see something like this come back:

2.0.3

Install SASS/Compass

To install just SASS:

gem install sass

To install SASS and Compass:

gem install compass

Having reached this point, it should be plain sailing. You can follow the SASS Tutorial at http://sass-lang.com/tutorial.html and/or the Compass Installation guide at http://compass-style.org/install/.

One last gotcha

We're almost there now. There's one last gotcha, which causes the compass watcher to crash when you change a file. For a fix, see this comment on StackOverflow: http://stackoverflow.com/a/6552159/109282

According to this commit, this is a problem caused by a compass dependency called FSSM. It is used to monitor file changes in compass. A workaround is described in this comment.

It seems that FSSM detects that ruby is running inside a Windows box, and treats paths in the Windows' way (C:\blabla). Commenting out the line 26 of the file <fssm_gem_path>/lib/fssm/pathname.rb makes compass watch work as expected. You can also add

unless path[0, 1] == File::SEPARATOR

to the end of line 26 to make it work.