CSS Compass project fails to locate @import "compass";


Staff member
<strong>The Problem:</strong>

I am updating a website that was created using <a href="http://compass-style.org/install/" rel="nofollow noreferrer">Compass</a>. I installed Compass and then ran the following command to set up Compass with my existing project. Next I imported Compass into my global.scss file. <a href="https://github.com/armin-pfaeffle/sass-autocompile" rel="nofollow noreferrer">SASS-Autocompile</a> <em>(a package for the text editor <a href="https://atom.io/" rel="nofollow noreferrer">Atom</a>)</em> fails to locate the file and throws a compilation error. I am not sure if this is an issue with the set up of compass or if it is a problem with SASS-Autocompile. Here are the steps I took which led up to this point.

compass create --sass-dir "scss" --css-dir "css" --images-dir "images"


Congratulations! Your compass project has been created.

You may now add and edit sass stylesheets in the scss subdirectory of your project.

Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.

You can configure your project by editing the config.rb configuration file.

You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
  1. To compile on demand:
     compass compile [path/to/project]
  2. To monitor your project for changes and automatically recompile:
     compass watch [path/to/project]

More Resources:
  * Website: http://compass-style.org/
  * Sass: http://sass-lang.com
  * Community: http://groups.google.com/group/compass-users/

To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:
  &lt;link href="/css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="/css/print.css" media="print" rel="stylesheet" type="text/css" /&gt;
  &lt;!--[if IE]&gt;
      &lt;link href="/css/ie.css" media="screen, projection" rel="stylesheet" type="text/css" /&gt;


@import "compass";

<strong>Terminal:</strong> <em>(while in project root dir)</em>

compass compile


  warning Webkit only supports pixels for the start and end stops for radial gradients. Got: 70%
    write css/global.css

Then I save my global.scss file which runs SASS-Autocompile and this error is presented.

<strong><em>SASS-Autocompile: Compiliation Error</em></strong>

  "message": "File to import not found or unreadable: compass.
  Parent style sheet: /Users/robby/Documents/reseminary/wordpress/wp-content/themes/dev.reseminary.edu/scss/global.scss",