Compass on Windows

This post documents my latest compass install on Windows which should be simple enough. I ran into a minor issue and was getting an error:

gem install compass
ERROR:  Error installing compass:
        The 'ffi' native gem requires installed build tools.

How to install the build tools

Go to the same place that has the RubyInstaller for Windows, http://rubyinstaller.org and select Downloads. Download the Development Kit (build tools) that corresponds with your version of Ruby. If you need to install Ruby (required), it is recommended that you use the Ruby 1.9.3 installers. I noticed that a newer version of the Ruby 1.9.3 installers were available, might as well get the updates. To summarize, here are the two packages I downloaded for my Windows 8.1 machine:

Install or update Ruby using the Ruby 1.9.3-p550 RubyInstallers before installing the DevKit. Check your installed version as follows:

C:\>ruby --version
ruby 1.9.3p550 (2014-10-27) [i386-mingw32]

Important - during Ruby Setup, make sure “Add Ruby executables to your PATH.” is selected:

Setup - RubyInstallers
Setup - Ruby 1.9.3

After extracting the DevKit to C:\RubyDevKit, run these these commands:

C:\RubyDevKit>devkitvars.bat

Adding the DevKit to PATH...

C:\RubyDevKit>ruby dk.rb init

[INFO] found RubyInstaller v1.9.3 at C:/Ruby193

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

C:\RubyDevKit>ruby dk.rb install

[INFO] Updating convenience notice gem override for 'C:/Ruby193'
[INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'
Test the DevKit install
C:\RubyDevKit>bash

bash-3.1$ gcc --version
gcc.exe (tdm-1) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bash-3.1$ exit
exit

Install Compass

gem install compass

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Fetching: rb-inotify-0.9.5.gem (100%)
Fetching: compass-1.0.1.gem (100%)
    Compass is charityware. If you love it, please donate on our behalf at http:
//umdf.org/compass Thanks!
Successfully installed ffi-1.9.6
Successfully installed rb-inotify-0.9.5
Successfully installed compass-1.0.1
3 gems installed
Installing ri documentation for ffi-1.9.6...
Installing ri documentation for rb-inotify-0.9.5...
Installing ri documentation for compass-1.0.1...
Installing RDoc documentation for ffi-1.9.6...
Installing RDoc documentation for rb-inotify-0.9.5...
Installing RDoc documentation for compass-1.0.1...
comments powered by Disqus