简体   繁体   中英

Some errors while installing Chocolatey

I'm currently trying to download Jekyll on Windows 10, and I'm having difficulty installing Ruby through Chocolatey. I'm following the instructions provided on this website: https://jekyllrb.com/docs/windows/

Here is the error that is causing some trouble. I have entered choco install ruby -version 2.2.4 and it gave me this error:

By installing you accept licenses for the packages.
Progress: Downloading ruby 2.2.4... 100%
ruby not installed. An error occurred during installation:
 Access to the path 'C:\ProgramData\chocolatey\lib\ruby\tools' is denied.
ruby package files install completed. Performing other installation steps.
This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\.chocolatey' is denied.
This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\.chocolatey' is denied.
Maximum tries of 3 reached. Throwing error.
Cannot create directory "C:\ProgramData\chocolatey\.chocolatey". Error was:
System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\.chocolatey' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.<>c__DisplayClass64.<create_directory>b__63()
   at chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1.<retry>b__0()
   at chocolatey.infrastructure.tolerance.FaultTolerance.retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.create_directory(String directoryPath)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.create_directory_if_not_exists(String directoryPath, Boolean ignoreError)
Access to the path 'C:\ProgramData\chocolatey\.chocolatey' is denied.

Try to run the installation program with administrator rights. The error shows that the access to the directory programData is denied!

Specifically, since you run in windows cmd, run the cmd.exe as Administrator. Then, continue choco install ruby

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM