sass not recognised using Windows command shell

前端 未结 4 1000
醉梦人生
醉梦人生 2021-01-28 22:14

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

相关标签:
4条回答
  • 2021-01-28 22:51

    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.
    0 讨论(0)
  • 2021-01-28 22:54

    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!

    0 讨论(0)
  • 2021-01-28 23:05

    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.

    0 讨论(0)
  • 2021-01-28 23:15

    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.

    0 讨论(0)
提交回复
热议问题