Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to extract files from \cache\rubyinstaller, 7zip, decompress error #24

Open
vladyslav-androshchuk opened this issue Feb 15, 2024 · 4 comments

Comments

@vladyslav-androshchuk
Copy link

Hello!

During the execution of rbenv install 3.1.0 on Windows 10 in PowerShell, I'm getting the following error:

C:\Ruby\rbenv\bin\rbenv install 3.1.0
Begin downloading ...
=> https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.0-1/rubyinstaller-3.1.0-1-x64.7z
Loading rubyinstaller-3.1.0-1-x64.7z from cache
Installing 3.1.0-1 ...
Exit code was 7!
Failed to extract files from \cache\rubyinstaller-3.1.0-1-x64.7z.
Log file:
  \cache\7zip.log
 'decompress error')

\cache\7zip.log:

Command Line Error:
Too short switch:
-o

7zip v23.1.0 was installed using Chocolatey.

@ccmywish
Copy link
Collaborator

Hi @vladyslav-androshchuk

Thanks for reporting. I find that, the 7zip version v23.1.0 from Chocolatey is strange, because I don't find that version from a quick look at https://www.7-zip.org/download.html

I download the latest 24.01 beta (2024-01-31), find that -o option is still working.

7-Zip (a) 24.01 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-01-31

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...] [@listfile]

<Commands>
  a : Add files to archive
  b : Benchmark
  d : Delete files from archive
  e : Extract files from archive (without using directory names)
  h : Calculate hash values for files
  i : Show information about supported formats
  l : List contents of archive
  rn : Rename files in archive
  t : Test integrity of archive
  u : Update files to archive
  x : eXtract files with full paths

<Switches>
  -- : Stop switches and @listfile parsing
  -ai[r[-|0]][m[-|2]][w[-]]{@listfile|!wildcard} : Include archives
  -ax[r[-|0]][m[-|2]][w[-]]{@listfile|!wildcard} : eXclude archives
  -ao{a|s|t|u} : set Overwrite mode
  -an : disable archive_name field
  -bb[0-3] : set output log level
  -bd : disable progress indicator
  -bs{o|e|p}{0|1|2} : set output stream for output/error/progress line
  -bt : show execution time statistics
  -i[r[-|0]][m[-|2]][w[-]]{@listfile|!wildcard} : Include filenames
  -m{Parameters} : set compression Method
    -mmt[N] : set number of CPU threads
    -mx[N] : set compression level: -mx1 (fastest) ... -mx9 (ultra)
  -o{Directory} : set Output directory

So, I suggest you can try install 7zip by scoop or just manually install another version and save it into the PATH.

@ccmywish
Copy link
Collaborator

@vladyslav-androshchuk
Copy link
Author

Hi @vladyslav-androshchuk

Thanks for reporting. I find that, the 7zip version v23.1.0 from Chocolatey is strange, because I don't find that version from a quick look at https://www.7-zip.org/download.html

I download the latest 24.01 beta (2024-01-31), find that -o option is still working.

7-Zip (a) 24.01 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-01-31

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...] [@listfile]

<Commands>
  a : Add files to archive
  b : Benchmark
  d : Delete files from archive
  e : Extract files from archive (without using directory names)
  h : Calculate hash values for files
  i : Show information about supported formats
  l : List contents of archive
  rn : Rename files in archive
  t : Test integrity of archive
  u : Update files to archive
  x : eXtract files with full paths

<Switches>
  -- : Stop switches and @listfile parsing
  -ai[r[-|0]][m[-|2]][w[-]]{@listfile|!wildcard} : Include archives
  -ax[r[-|0]][m[-|2]][w[-]]{@listfile|!wildcard} : eXclude archives
  -ao{a|s|t|u} : set Overwrite mode
  -an : disable archive_name field
  -bb[0-3] : set output log level
  -bd : disable progress indicator
  -bs{o|e|p}{0|1|2} : set output stream for output/error/progress line
  -bt : show execution time statistics
  -i[r[-|0]][m[-|2]][w[-]]{@listfile|!wildcard} : Include filenames
  -m{Parameters} : set compression Method
    -mmt[N] : set number of CPU threads
    -mx[N] : set compression level: -mx1 (fastest) ... -mx9 (ultra)
  -o{Directory} : set Output directory

So, I suggest you can try install 7zip by scoop or just manually install another version and save it into the PATH.

Hey! Somehow it's extremely hard to install 7zip today, any version from Choco doesn't work. Scoop can't install it, because the install URL is not accessible, as well as links from official sites. Maybe we can use other options for decompression, without 3d parties?

Also, we are using puppet to setup our machines, so only automation.

Thanks for your time.

@ccmywish
Copy link
Collaborator

ccmywish commented Feb 17, 2024

@vladyslav-androshchuk

Temporarily it's not possible to decompress without 7z.

Based on your comments any version from Choco doesn't work, I doubt it's may not because of 7zip.

You can insert a debug line like Write-Host $7zPath $ArgList -LogPath $LogPath before:

https://github.com/ccmywish/rbenv-for-windows/blob/main/lib/decompress.ps1#L47

to check what went wrong.

Just a guess: I guess maybe it's your path includes a space or other characters that cause the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants