lappy
lappy

Reputation: 687

sass not recognised using Windows command shell

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

Upvotes: 1

Views: 17599

Answers (5)

Jose Furtado
Jose Furtado

Reputation: 1

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.

Upvotes: 0

ValRob
ValRob

Reputation: 2682

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.

Upvotes: 2

Mehdi Dehghani
Mehdi Dehghani

Reputation: 11601

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.

Upvotes: 0

Jørgen R
Jørgen R

Reputation: 10806

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.

Upvotes: 5

lappy
lappy

Reputation: 687

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!

Upvotes: 0

Related Questions