Why is 'ruby' not recognized as an internal or external command? - ruby

Path in user variable is the default path from the installation:
C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby1.9.3\bin
Path in system variable is directed to:
C:\RailsInstaller\Ruby1.9.3\bin
When I open the Command Prompt with Ruby and Rails, the command prompt says "'ruby' is not recognized as an internal or external command" immediately without any input.
The command prompt worked before. After I re-installed it using various methods due to unsuccessful setup, it got like this.
How can I fix it?

Please restart cmd before running ruby command.

In Windows PC:
To add bin path of your installed ruby to PATH environmental variable
1. right click on "My Computer" -> Properties -> Advanced System Settings -> Environmental Variables -> Select "Path" ->Edit
Example path shown below:
D:\Ruby22\bin;
2. Restart cmd after changes
Refer below image:
Ruby Path setting in Windows 7 and other windows OS

So,
C:\RailsInstaller\Ruby1.9.3.\bin is the place where your ruby.exe is saved?
If that's correct, you should be able to access the ruby commands via the Command Prompt.
When you try: REG QUERY "HKCU\Environment" in the console, is there an output like?:
PATH REG_EXPAND_SZ C:\RailsInstaller\Ruby1.9.3.\bin

Ensure you have the correct x32 or x64 bit version of Ruby
installed.
Ensure you have the PATH environment variable setup, this should be
done automatically if selected upon install.
Lastly ensure you restart your command prompt.

Related

Anaconda Packages

I have Anaconda installed on my computer but when I type a command in cmd I only get 'conda' is not recognized as an internal or external command,
operable program or batch file. What could be the problem? It's the same with pip.
I can see that it is installed in my settings.
So Anaconda should have added jupyter to your PATH automatically during the install if you selected that option as shown in the installation video, if you did not select it, you need to do this manually, here are the steps to do so:
1)go to mu cpmuter properties and click on ADVANCE SYSTEM SETTINGS
2)Select the Advanced tab.
3)Click the Environment Variables button.
4)Under System Variables, select Path, then click Edit.
You'll see a list of folders, as this example for my system shows something like:
C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
You will notice that each of these file paths are separated by a semicolon ;
You can add additional folders that you want to include in searches. In this case, you need to add Anaconda to your path, it will be something like: C:\Users\myusername\Anaconda2
Add that to the list, make sure your spacing is correct
You'll need to restart the processes (e.g., command prompt) that use the system path to see the added folders.
-----------------------------------------------------------------------------## YOU CAN ALSO AVOID THIS MANUAL PROCESS ##
ANOTHER METHOD is reinstall this and while doing this make sure of thing that is shown in the scr shot below
while installing the anaconda the dialogue box appears giving two options
add anaconda to my path enviorment variable
register anaconda as my default python version
select both of this options though system will not recommend this but you have to mark
thankyou!!
all the best!!
Open your Anaconda Prompt instead of just your command prompt. Then type "conda list," you should get the correct output. I suspect that you did not add Anaconda to your PATH during installation and that's why your regular command prompt won't recognize the conda commands.
Find where you anaconda is installed. Usually, it is under %USERPROFILE%\AppData.... You can set path using SETX PATH on CMD. e.g. I have installed anaconda3. It was installed in its default path.
e.g.
SETX PATH “%USERPROFILE%\AppData\Local\Continuum\Anaconda3; %USERPROFILE%\AppData\Local\Continuum\Anaconda3\Scripts”
If you do not know where anaconda was installed, you can open "Anaconda prompt" app. You can see the environment path to your anaconda [You can find "Anaconda prompt" using Search Windows.

Why is PowerShell "not recognized" when installing Chocolatey?

I went to the Chocolatey website and copied the text for installing it and pasted into the administrator cmd.exe (using Windows 7). When I run the command I get:
'powershell' is not recognized as an internal or external command, operable program or batch file.
This GitHub article with Chocolatey installation instructions says:
This really is the easiest method because it requires no configuration of PowerShell prior to executing it.
It turns out that #balint was right about the path being incorrect. The path variable at some point had gotten replaced instead of appended to. I was able to install Chocolatey successfully after appending all the paths that had been erased previously!
you have some faulty PowerShell installation, or it is missing from the Windows PATH variable. Run in an administrator cmd:
cmd> set PATH=%PATH%;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

The term 'node' is not recognized... In Powershell

I have been trying to resolve this issue for the whole day.
When I run node -v or npm install in cmd prompt, it works absolutely fine. But when I run the same commands in Powershell, it gives the following error:s
PS C:\Users\Anubhav.Trivedi> node -v
The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelli
ng of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:5
+ node <<<< -v
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I tried uninstalling node js and reinstalling it. Added node js path C:\Program Files (x86)\nodejs\ to enviroment variables (system variables). Restarting computer. But nothing seems to work.
Kindly let me know, what am I missing here.
These issues cannot be installed from the Package Manager console, so I had to browse lot of things to fix the issues and finally I got the solution.
Maybe we followed these scenarios
Missing Node.js software
Wrongly updated Windows environment path
Installed in the wrong path
Old version of Node.js software
You can download the latest Node.js software here.
Update Path
After installation, automatically create nodejs folder in this path “C:\Program Files (x86)” or “C:\Program Files “.
Open Control Panel -> User Accounts -> Change my environmental variable and verify the path Variable value “C:\Program Files (x86)\nodejs” or “C:\Program Files\nodejs “.
new => user = path => value = C:\Program Files (x86)\nodejs and after apply that.
and close Editor and restart it. it will work correctly.
note :- enter your path instead of copy of this path.
As dan-gph mentioned check the Path in environment variable using script $env:path -split ';' | Select-String nodejs and once you update the Path in environment variable, make sure to restart powershell and also restart explorer.exe. This would resolve the issue.
If you still face issues, check which nodejs you have installed (32bit or 64bit). Install 32 bit only as powershell or cmd are 32bit programs
Model for VSCode editor
C:\Program Files\nodejs
C:\Program Files\nodejs\node_modules\npm\bin
Search PATH environment variable.
Add the above paths into the Environment variables (both user
variable path and system variable path).
Restart VSCode.
Open a new terminal in VSCode
run node --version output should equal v16.13.0
If you installed NodeJs recently after opening the IDE like Visual Studio Code or any other IDE that includes the terminal you are trying. then try this.
Restart the IDE, If you installed NodeJs recently after opening the IDE like Visual Studio Code or any other IDE that includes the terminal you are trying.
Restart the CommandLine if you installed NodeJs after you opened the CommandLine.
I hope it will be fixed most of the time by following these simple steps.
Happy Coding!
open control panel then--
user accounts
|
user accounts
|
change my environment variables
|
new
|
(In variable name use)--Path
|
(In variable value use)C:\Program Files\nodejs
|
ok
After that just restart you terminal
chances are that you messed up with your system path, if it's the case, a very straight forward solution will be re-installing node and npm but don't forget to close and re-open powershell/cmd
Note: i thought that restarting computer has no effect on path but in an accident someone just deplug my laptop from power and after i turned it on everything was repaired and OK!
Reinstall/repair the application and close the vs code powershell
I've got the same error. Simply check below instructions. If all they are done. Just restart your computer. Then it will worked for me. I just restarted my computer.
List item
Missing Node.js software
Wrongly updated Windows environment path
Installed in the wrong path
1.find nodejs folder
go to environment variable in windows
edit path and add "find nodejs folder"
Restart computer
This issue corrected after updated my environment variable path
i just copy the path from path value in user to path value in system check image attachment.
https://i.stack.imgur.com/11uCk.png
path change image below
Go to Control Panel\System and Security\System on Windows 10.
Go to advance properties.
Advance system settings -> advance system settings -> Environment Variables Or type edit the system environment variables in the windows search.
Add "C:\Program Files\nodejs" ,"C:\Program Files\nodejs" and "C:\Program Files\nodejs\node_modules\npm\bin" to the user and system variable (path)
restart the cmd and run again.
Hope it will work.

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)

Problems installing Python 27 on Windows 7 - cannot add Python to PYTHON PATH

I installed Python 2.7.3 on my Windows 7 computer using the binary, the first link. After installing it, IDLE works but nothing else recognizes Python. For example, typing python at the command prompt returns the message "'Python is not recognized as an internal or external command, operable program or bath file."
Following this post, I made sure that python 2.7 was in the PYTHONPATH environment variable. However, that didn't help.
What should I do?
PYTHONPATH system variable is used by Python itself to find directories with installed packages.
PATH system variable is used by OS (particularly Windows) to find executables which can open certain files like *.py scripts.
So, you need to add directory with python.exe (for example C:\Python27) to PATH system (or user) variable and not to PYTHONPATH. It can be done the same way as described in the link you've found in the same tool window.
For example on my machine PATH system variable is set to C:\Python27;C:\MinGW\bin;...
Like Vladimir commented, for setting up python in windows, you need to add the directory where your python.exe is located (for example C:\Python27) to PATH
You can confirm if python is in your environment variables by looking at the output of echo %path%
Keep in mind that after editing the PATH variable using the control panel, you have to open a new terminal, as the setting will NOT be updated in existing terminals.
Another possibility is that you added the wrong path to the PATH variable. Verify it.
The bottom line is, if the directory of your python.exe is really in PATH, then running python will really work.
Here are your steps:
Right-click Computer and select Properties.
In the dialog box, select Advanced System Settings.
In the next dialog, select Environment Variables. In the User Variables section, edit the PATH statement to include this:
C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts\;
Now, you can open a command prompt (Start Menu|Accessories or Start Menu|Run|cmd) and type:
C:\> python
That will load the Python interpreter!
You can install for single user rather than choosing the option of "Install for all users". I was facing the same issue, but when I tried installing just for myself, I was able to install successfully.

Resources