sass not recognised using Windows command shell - ruby

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

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.

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.

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!

If you using Windows 10 v1607 (latest update as March 2017), you need to follow following steps:
Right-click on start menu & select System
Click on Advanced System Settings (left hand column)
Click on Environment variables button
In top section, select Path (or PATH), then click on Edit button
Inside opened window, click on New button
In selected input area, type (for ex.) C:\Ruby22-x64\bin\ (its must be path to ruby's bin folder)
Click OK, twice
Re-open Command-Prompt, now sass is ready to watch and compile your sass files.

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.

Related

WARNING: dot command dot cannot be run

I am working on documentation for a software. And i have used graphviz directive inside my rest file.
.. graphviz::
:align: center
However when i run
make html
i get an error for dot command even though graphviz is installed in my virtenv (OS - mac). I have updated the conf.py to have the extension 'sphinx.ext.graphviz'
WARNING: dot command ‘dot’ cannot be run (needed for graphviz output), check the graphviz_dot setting
The problem could be referred to an incorrect configuration of "dot" executable from GraphViz PATH.
See: https://github.com/IQSS/dataverse/pull/7230
On my windows machine, I solved it following these steps:
Check if the dot installation has been performed, going in the installation path (the default installation path is: C:\Program Files (x86)\GraphvizX.XX\bin) and running here the command dot.exe
Go to Control Panel > System and Security > System, and on the right side navigation panel, click the Advanced systems settings link.
In Advance settings, a dialogue box opens that shows the Environment Variables button. Click the button.
Select the entry Path in the system variables section and add C:\Program Files (x86)\GraphvizX.XX\bin to the existing path.
I think the problem could be solved on your OS machine just adding the PATH using the export command, such as:
export PATH=$PATH:~/opt/bin
Ref: https://bobswift.atlassian.net/wiki/spaces/GVIZ/pages/20971549/How+to+install+Graphviz+software
https://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/
It looks like Sphinx can't find dot executable. Make sure it's in your path.

How to install Dart Sass?

The instructions on the website say:
You can install Sass on Windows, Mac, or Linux by downloading the package for your operating system from GitHub and adding it to your PATH. That's all—there are no external dependencies and nothing else you need to install.
I downloaded the Windows package from here: https://github.com/sass/dart-sass/releases/tag/1.10.1 and now what? Where do I place the zip? Do I need to extract it? I have no idea what this means - "To install Dart Sass 1.10.1, download one of the packages above and add it to your PATH." Sass is not being recognized when I try to check the version from the command line.
Can someone provide a step by step guide?
I've also installed Ruby, if it matters (but I don't want Ruby Sass, I want Dart Sass).
For windows 10
Go here dart-sass and download dart-sass which is suitable for your operating system.
Extract it where you want.
Open windows search and search this "system environment variables" then click it to open.
Click "Environment Variables"
Under system varibles find the PATH variable, select it, and click "Edit".
If there is no PATH variable, click "New" and write here PATH.
Go your dard-sass folder and copy directory.
Add your directory to the beginning of the variable value followed by ; (a semicolon). For example, if the value was C:\Windows\dart-sass, change it to C:\Users\Me\bin;C:\Windows\dart-sass. If there is not another directory just add your directory here. Then click "Ok".
Open "Command Prompt".
Write here "sass --version" and click enter to be sure it installed correctly.
Create style.scss and style.css file.
Write on Command Prompt "cd" then your directory(where is style.scss and style.css file). For example "cd Desktop\webdev"
Then write this "sass --watch style.scss style.css". Then minimize it.
That's it. You can open your text editor then style.scss file and write your Sass code. It's automatically compile to the css code.
https://katiek2.github.io/path-doc/

Unable to install SASS on Windows machine using ruby

I have just install Ruby Installer 2.3(x64), on my Windows machine as I wanted it for SASS.
On typing
gem install sass in "Start command prompt with Ruby" , it shows the error:
'gem' is not recognised.
Please Help
Try running ruby -v on the command line. If it throws up an error, try adding ruby to path. To add this:
Go to Computer.
Click on properties at the top left
Click on Advanced System Settings
Click on Environment Variables at the bottom right of the popup
Open another tab and look in the C: drive to find Ruby is installed. It should be C:\Ruby23-x64\bin or so. Copy the path.
Go back to the environment variable and click on PATH.
Choose edit option and add the a semi-colon ; before pasting the ruby path copied.
Note
Your windows machine may be slightly different. I am using Surface Pro 3 which runs on Windows 8.

How do I install gradle on Windows 10?

I tried some ways with the path thing, but it did not work. When I edit the path in the System variables it opens up all the paths, not like in tutorials, where I should just put the ;%GRADLE_HOME%\bin at the end.
Download Gradle and unzip it to where you want it installed.
Then in Windows Search, search for "System" and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables
Then click New button under user variable and add GRADLE_HOME to variable name and path pointing to the root directory of unpacked files from the Gradle to variable value.
In System variable section select Path and then click the Edit button.
In next window click New button and add path pointing to the bin directory of unpacked files from the Gradle.
If you are window user then Scoop will be the best option to installs the tools you know and love. Scoop is simply a command line installer.
simply run this commandscoop install gradle
But first you need to install scoop using powershell command
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Note: if you get an error you might need to change the execution policy (i.e. enable Powershell) with following command
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
In case you're here and none of these answers "helped", try restarting the shell program.
I just spent more than an hour and I just had to restart my console window to do the trick.
Download Gradle and unzip it to where you want it installed. Then open your USER variables window for your user (similar to what you show) and create a GRADLE_HOME variable with a path pointing to the root directory of your downloaded Gradle distribution. Then add it to the PATH in your USER variables with something like:
%PATH%;%GRADLE_HOME%\bin
Notice that I have prepended the existing PATH variable onto the new one. You don't want to remove what's already there. Also, your image shows something else added to the path. You will want to add that on to the line above, something like:
%PATH%;%YOUR_OTHER_STUFF%;%GRADLE_HOME%\bin
So that it won't be lost either.
This is what I have done on Windows for years. Other options are to use something like http://sdkman.io/; however, that requires extra work on Windows since it's really meant for OSes with a real terminal.
choco install gradle in shell/cmd.
of course, you gotta install the chocolatey first from here
Chocolatey - the package manager for Windows.

Don't get GraphViz and phpDocumentor to work

I'm trying to create a php documentation on my local XAMPP host (on Windows 7) with phpDocumentor.phar (v2.). It gives me (after parsing all the files) this error:
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
I searched a lot, but nothing helps. What does 'path' means? If I open a command box at any location I can start the dot.exe (which gives me no output but waiting prompt). In my environment path variable the bin folders is added. GraphViz is installed correct in Program Files and runs standalone.
What could I do or check?
In order to get GraphViz running properly with a Windows based phpdoc installation, just put the GraphViz program directory (c:\some\path\graphviz\release\bin) to the Windows Path system variable.
In order to do this, follow these steps (Win7, please provide your OS version if this doesn't apply to your situation):
From the desktop, right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab.
In the Advanced section, click the Environment Variables button.
In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button.
Different directories are separated with a semicolon:
C:\Program Files;C:\Winnt;C:\Winnt\System32
It will most likely look a bit different in your enviroment, so please just take this for an example. Just add the GraphViz Path at the end like this:
C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\somefolder\graphviz\release\bin
I'm not too sure if you have to reboot your system after changing this value. You had to do this in the old days of Win2k, and I just don't know if this still applies to modern Windows versions. It surely doesn't hurt!
After this, phpdoc should be able to find the dot command.
The steps to resolve this error are:
download Windows Packages from
https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)

Resources