0

I'm running cmd command buildpack-packer --uncached (or any other option of buildpack-packer). I had many error messages prior that. They were caused by bad content of manifest.yml. I corrected them. So now I receive this error message: Zip is not installed (RuntimeError)

enter image description here

I used gem install to install zip gem and rubyzip gem (as first did not work, so I tried a second). So now both not helping to get rid of this error message.

Here is a part of the installed gem list:

enter image description here

And here is the code that drops this error (found it based on the error message in file: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/buildpack-packager-2.3.4/lib/buildpack/packager.rb):

enter image description here

I'm quite new in Ruby, so maybe I do some very basic mistake...

Thx in advance!!

Community
  • 1
  • 1
Andr
  • 88
  • 1
  • 10

1 Answers1

1

Please don't use pictures or screenshots in your post. Use plaintext only.

I think you are misunderstanding the code:

_, _, status = Open3.capture3('which zip')

It checks if you have any zip program (executable) installed not a ruby gem (library). It actually executes which zip in your cmd shell.

For example on my system it found an oracle one:

c:\> which zip
/c/app/oracle/client11g/product/11.2.0/client/bin/zip

Then if you test it in irb:

irb(main):004:0> _, _, status = Open3.capture3('which zip')
=> ["/c/app/oracle/client11g/product/11.2.0/client/bin/zip\n", "", #<Process::Status: pid 10944 exit 0>]

You can see that the executable was found and success state is indicated by the 0. The variable status holds the return message - status => #<Process::Status: pid 10944 exit 0>

I have the which program from dev_kit:

 c:\>which which
/c/prg_sdk/ruby/dev_kit/bin/which
tukan
  • 17,050
  • 1
  • 20
  • 48
  • Thx @tukan! I added to PATH variable 7-ZIP path, but that did not solved the issue. Is there a special way to install a ZIP app on Windows.. to have which gem (that you mentioned above) find it, or is there a special ZIP app for this? – Andr Jun 27 '18 at 09:49
  • 1
    @Andr: As you may have noticed the `which` tool is originally a unix tool. First step is to have the `which` tool installed on your system. Do you have it? If you have it then you can check your current path with `@path`. (Don't forget that if you change path you need to restart your cmd so the new path will be reflected) – tukan Jun 27 '18 at 10:44
  • Thx @tukan: understand. I have the which command installed on my machine. I checked and found it based on your answer (thx!!). I'm on windows right now.. and would like to remain on win. I would like to install a zip that 'which' will find. Not sure how I can do that. 7-zip is on my workstation, added to path variable.. restarted cmd... but which zip drops the same error... – Andr Jun 27 '18 at 10:47
  • In my example I have path `C:\app\oracle\client11g\product\11.2.0\client\bin` in my `PATH` environment variable. If I check it with `dir zip*`, I get `C:\app\oracle\client11g\product\11.2.0\client\bin` -> `zip.exe` – tukan Jun 27 '18 at 10:47
  • the easiest way to get `which` script on your windows is to use `MSYS2` - https://www.msys2.org/ – tukan Jun 27 '18 at 10:49
  • 1
    @Andr yes that is indeed the problem. The script is checking for `zip` if you need to check for 7z you would need to adjust it to `which 7z` or install zip.exe which you need. – tukan Jun 27 '18 at 10:51
  • to get zip for windows and command line - https://sourceforge.net/projects/infozip/files/ – tukan Jun 27 '18 at 10:55
  • found zip.exe on my system: C:\Program Files (x86)\C4ebreg. Thx @tukan for your help! Issue solved! – Andr Jun 27 '18 at 11:03