Install patch file in Redmine for windows - windows

I want to install a patch file in Windows server for redmine. When executing in cmd:
patch -p0 < file.patch
I get the error: patch commmand not found
Any ideas?

Patch takes a patch file containing a difference listing produced by the diff program and applies those differences to one or more original files, producing patched versions.
It's native to unix/linux os-es, but for Windows, you need to install patch.exe and add it to system's or user's environment variable PATH
Probably best way is to install
http://gnuwin32.sourceforge.net/packages/patch.htm
On Windows it differs from version to version, but it looks somewhat like this:
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.
Then, in the Environment Variables window, edit the Path variable in the Systems Variable.
Add or modify the path lines with the paths you wish your console to access. Directories are separated with a semicolon as shown below.
C:\Program Files\; C:\Windows\System32
Example of path location in windows : C:\util\patch\

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 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.

Windows 10 cannot recognize Git

I have installed Windows 10 x64 on my laptop, and then go with latest Git as well (Git-2.6.3-64-bit). As I see on my laptop, Git now is installed at this directory: C:\Users\MyPC\AppData\Local\Programs\Git (I have no chance to specify another particular folder because it's done automatically during Git installation). The options "Use Git from the Windows Command Prompt" and "Use OpenSSH" are already selected, the windows path is updated with Git dir. And after all, the problem is, Windows cannot recognize where Git is to call. I've tried git --version but it's unrecognized from Windows.
My questions are (on Windows 10 Pro x64):
1. Can we specify another installation folder for Git?
2. In Git dir/bin, there no ssh.exe, while in OpenSSH selection dialog, it tells me "This uses ssh.exe that comes with Git". So where is it, the built-tin SSH client?
3. I'm doubting that now Windows 10 doesn't accept any external program installed on %USERPROFILE%/AppData to be included to system path. Is it correct?
4. How to make Windows "see" Git?
Just solved this myself this was a very frustrating journey but for me the following got me going:
Make sure c:\Windows\System32\OpenSSH\ is in your path variables (yea I know Windows should see this on its own)
Go to C:\Users\<>.gitconfig edit your global git config file to point to the correct ssh.exe 'C:/Windows/System32/OpenSSH
Make sure your id_rsa.ppk file is in C:\Users\<>.ssh If you don't have an SSH key yet generate one and make sure it ends up in this folder
You may also want to check that your OpenSSH Authentication Agent is started in Windows Services
Can we specify another installation folder for Git?
Try running the installer as an administrator, so it can be installed to Program Files. I'm not sure how to specify a custom path.
In Git dir/bin, there no ssh.exe, while in OpenSSH selection dialog, it tells me "This uses ssh.exe that comes with Git". So where is it, the built-tin SSH client?
Some digging told me that it might live inside the .ssh folder in the Git installation, so C:\Users\MyPC\AppData\Local\Programs\Git\.ssh
I'm doubting that now Windows 10 doesn't accept any external program installed on %USERPROFILE%/AppData to be included to system path. Is it correct?
AFAIK you can add any directory to your path.
How to make Windows "see" Git?
Add C:\Users\MyPC\AppData\Local\Programs\Git to your path:
Start the System Control Panel applet (Start - Settings - Control Panel - System).
Select the Advanced tab.
Click the Environment Variables button.
Under System Variables, select Path, then click Edit.
You'll see a list of folders, as this example for my system shows: C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Intel\DMIX;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Bonjour\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Misc
You can add additional folders that you want to include in searches. I add a "C:\program files\misc" entry into which I place my standalone utilities, instead of copying them into C:\windows. Click OK.
You'll need to restart the processes (e.g., command prompt) that use the system path to see the added folders.
From http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

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