Search code examples
csswindowssasscompass-sass

Configuring Compass on Windows


I'm on Windows, and I have SASS running successfully in my project. Now, I want to include compass so I can take advantage of the pre-written mixins, etc.

First I simply tried this statement from within my working sass file: @import "compass/css3/transform";

Naturally, this didn't work since I didn't have compass installed, so I navigated to my Ruby directory and successfully installed the compass gem within c:/ruby193/bin. I can now successfully create compass projects within c:/ruby193/bin, but that doesn't do me much good.

I need run compass commands within my site, which lives here: c:/inetpub/mysite. When I try to do so, however, I get compass is not recognized as internal or external command

How can I get compass to work where I want it?

EDIT: a large part of my problem was that Ruby was installed without adding itself to the Windows Path environment variables, so I could only run SASS and Compass commands from within the C:/Ruby193/bin directory. This caused problems for me since, as a result, I thought that was where I needed to install compass. Anyhow, after figuring that out, I still haven't been able to get compass to work, but am planning on uninstaling SASS, Compass, and Ruby and giving this thing another try from scratch. I marked Stooboo's answer as correct since it was the best and most accurate, especially given the information he had to work with. Thanks!


Solution

  • here's how I do it

    (One time)

    1. install ruby http://rubyinstaller.org/

    2. install compass, in a command window enter

      gem install compass
      
    3. to add compass to an MVC project, navigate to project folder and in a command window enter

      compass create
      

      you will get the default config.rb ... but here is my usual one

      http_path = "/"
      css_dir = "content/css"
      sass_dir = "content/sass"
      images_dir = "images"
      javascripts_dir = "scripts"
      
    4. to install bootstrap (for more info see https://github.com/thomas-mcdonald/bootstrap-sass) add

      require 'bootstrap-sass'
      

      to your config.rb

      enter (in your command window)

      gem install bootstrap-sass
      

      (I had to do a (in your command window) gem update after this but you may not need to)

      enter (in your command window)

      compass install bootstrap
      

    (then ... every time you open the solution in Visual Studio)

    1. navigate to project folder
    2. in a command window enter

      compass watch
      

      (this will monitor project for saves and re-compile the scss files)

    Hope that helps

    Cheers Stu