3

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!

Brian FitzGerald
  • 3,041
  • 3
  • 28
  • 38

4 Answers4

14

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

stooboo
  • 917
  • 9
  • 15
  • NOTE: I don't use this method anymore .. instead latest Visual Studio with Web Essentials recompiles as necessary – stooboo Jun 14 '14 at 01:41
  • Ok, I had an error "while runing gem" > solution is here : http://stackoverflow.com/a/26141746/782013 – gordie Nov 24 '14 at 14:50
1

To install Compass, you should open your Windows console with Win+R, cmd and run:

gem update --system
gem update
gem install compass

Don't forget to remove all the stuff that you littered you Ruby installation with.

Andrey Mikhaylov - lolmaus
  • 23,107
  • 6
  • 84
  • 133
1

Use this command in order to add GEM to the Windows Path environment variables:

set PATH=C:\Ruby200-x64\bin;%PATH%

0

In the Ruby command you should write:

gem update --system

(this block of code updates all the gems in the Ruby)

Then you install sass like it:

gem install sass

(You said that you already has sass, so you don't need to write this code again.)

Then, you write this line:

gem install compass

(Now, you will have compass in your machine)

To know the version that was installed, you can write:

compass --version

To create a new project in your desktop machine, you can write this line of code:

compass create desktop/my-project

(This will create a compass folder in the desktop of your machine called my-project. I hope this is helpful.

Suelen D.
  • 21
  • 1