1

I've installed ruby and the sass gem on a Win 7 Enterprise box. I've had issues throughout the process, and had to download the gems and install them from local to avoid other issues.

gem install --local sass-3.1.19.gem

I'm trying sass --watch styles.sass:styles.css but I get the standard sass isn't recognised error from the command line.

I'm really new to ruby so I could well have missed a step.

Thanks in advance

Holger Just
  • 52,918
  • 14
  • 115
  • 123
lappy
  • 677
  • 3
  • 8
  • 15
  • Do you have the gem folder in your `$PATH`? – Jørgen R Jun 29 '12 at 09:27
  • I don't know much about windows, but read this http://www.voidspace.org.uk/python/articles/command_line.shtml#path – Jørgen R Jun 29 '12 at 10:08
  • Old thread but I found it when trying to use SASS on Windows, in the end I used 'Koala' for compilation which turned out GREAT: http://bobmckay.com/web/sass-css/sass-windows-tutorial-automatic-sass-compilation – Mr Fett Jul 09 '14 at 08:58

5 Answers5

5

In order to run commands without specifying full path, you need to have the path to the program in you PATH variable.

So if your program is located in C:\Programs\rubygems\gem\sass you'll need to add C:\Programs\rubygems\gem\ to PATH.

The process of adding a folder to PATH for the Windows command line prompt is described here.

For Windows Powershell, please check Setting Windows PowerShell path variable here on SO.

Community
  • 1
  • 1
Jørgen R
  • 10,568
  • 7
  • 42
  • 59
  • As an addition, I found it was necessary to restart `cmd` to get `sass` to appear in the command line – dKen Jun 01 '15 at 11:55
  • 1
    You don't necessarily need to restart `cmd`, but you need to reload the environment variables. I guess reastarting is the easiest way of doing this. – Jørgen R Jun 01 '15 at 12:13
2

After installing sass with NPM you got this:

npm install -g sass

file:///C:/Users/yourName/AppData/Roaming/npm/sass -> C:/Users/Administrador/AppData/Roaming/npm/node_modules/sass/sass.js

You can create the path. Go to environment variables - > system variables -> path -> Edith , and include file:///C:/Users/yourName/AppData/Roaming/npm/sass. Then, Accept everything. and it's done.

ValRob
  • 2,584
  • 7
  • 32
  • 40
0

Yes, putting the path to my ruby bin did indeed solve this.

My Computer --> right click, Properties --> Advanced system settings (left hand column) --> Environment variables --> find Path in the bottom list, highlight and edit --> include ;c:\path-to-ruby\bin at the end --> OK back out through the windows.

Thanks!

lappy
  • 677
  • 3
  • 8
  • 15
0

If you using Windows 10 v1607 (latest update as March 2017), you need to follow following steps:

  1. Right-click on start menu & select System
  2. Click on Advanced System Settings (left hand column)
  3. Click on Environment variables button
  4. In top section, select Path (or PATH), then click on Edit button
  5. Inside opened window, click on New button
  6. In selected input area, type (for ex.) C:\Ruby22-x64\bin\ (its must be path to ruby's bin folder)
  7. Click OK, twice
  8. Re-open Command-Prompt, now sass is ready to watch and compile your sass files.
Mehdi Dehghani
  • 10,970
  • 6
  • 59
  • 64
0

If you have Node installed use the node terminal instead of the windows/VSCode terminal.

Search for the Node terminal on the windows search tool placed on the right side of the windows start button.