user3052507
user3052507

Reputation: 59

how to install sass on windows

I cannot install Sass to my machine although I had downloaded ruby and printed on cmd :

cd C:/ruby22

then:

gem install sass 

but I get as result:

'gem' is not recognized as an internal command, operable program or batch file

how to install it please?

Upvotes: 4

Views: 11664

Answers (4)

Noman Chali
Noman Chali

Reputation: 330

You can install Sass on Windows by downloading the package for your operating system from GitHub select latest release extract the downloaded zip file

Now note download the extracted zip file path. For example D:\MyUserName\dart-sass

  • Set system environment variable. Step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and select "System (Control Panel)".
  • If you're using Windows 7, right click the "Computer" icon on the desktop and click "Properties". Click "Advanced system settings". Click "Environment Variables".
  • Under "System Variables", find the PATH variable, select it, and click "Edit". If there is no PATH variable, click "New".
  • Add your directory to the beginning of the variable value followed by ; (a semicolon). For example, if the value was C:\Windows\System32, change it to C:\Users\Me\bin;C:\Windows\System32.
  • Click "OK".

That's all—there are no external dependencies and nothing else you need to install.

  • now open command prompt
  • run sass --version

  • to be sure it installed correctly.

When you install Sass on the command line, you'll be able to run the sass executable to compile .sass and .scss files to .css files. For example:

sass --watch input.scss output.css

Once it's all set up, Sass Basics.


how i am converting .scss to .css

i have created a windows batch file in my project/content/scss folder(where all my scss files are) with below commands.

  1. cd.. (When you need to go one folder up, use the "cd.." command.)
  2. sass --watch scss\:scss\ (You can also watch individual files or directories with the --watch flag.)

saved it as

watch scss.bat

now whenever i am working on my sass file i run the "watch scss.bat"

the above command execute and watch my all my .scss files and update .css file for the same:)

Upvotes: 3

Mubarakcc7
Mubarakcc7

Reputation: 1

Step 1: https://rubyinstaller.org/ using CMD [gem install sass]

Step 2: http://compass-style.org/install/ using CMD

[gem update --system] [gem install compass]

for more details https://github.com/iz-syed/base_path/blob/master/README.md

Upvotes: 0

Arun
Arun

Reputation: 1

This is for Windows

  1. First step is to download ruby, install it, then add it to your executable path.
  2. Now go to your folder where ruby was installed and check if it was installed with ruby -v command.
  3. Then, open the folder where you have installed ruby and install sass using gem install sass.
  4. That's it!! You are good to go!! If you still have doubts, run sass -v and it will give you a version.

For Mac

Just run gem install sass as ruby is preinstalled on Mac.

Upvotes: 0

Bass Jobsen
Bass Jobsen

Reputation: 49054

  1. Install ruby, see: https://github.com/oneclick/rubyinstaller/wiki
  2. Open a command prompt, click Start, click Run, type cmd, and then click OK.
  3. Run gem install sass

Possible related to your issue: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file

Upvotes: 0

Related Questions