Search code examples
rubymsys2rubyinstaller

Install Ruby 2.4.1 in windows within corporate proxy. MSYS2 update fails


I am using ruby installer rubyinstaller-2.4.1-2-x64.exe to install ruby 2.4.1 on windows 10. It is successful and at the end of install MSYS2 installation is triggered. It is also successful. But MSYS2 system update fails with the following error.

mingw32.sig      96.0   B  93.8K/s 00:00 [#######################################] 100%
error: mingw32: signature from "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" is invalid
error: failed to update mingw32 (invalid or corrupted database (PGP signature))

Any workaround to fix this?

Note: The same installation package works perfectly in my home network. So I guess it is something to do with the corporate firewall.


Solution

  • I somehow made it work, by going through various SO answers. Following are the set of actions that made it work.

    1. Set proxy in env variables

      setx http_proxy="http://proxy.server.address:port" setx https_proxy="http://proxy.server.address:port" setx ftp_proxy="http://proxy.server.address:port" setx rsync_proxy="http://proxy.server.address:port"

    2. Delete all files from C:\msys64\var\lib\pacman\sync

    3. Open C:\msys64\mingw64.exe and run the command pacman -Syy

    4. Since pacman is working now, I returned to the original ruby installer 2 process. It worked!

      ridk install

      1 - MSYS2 base installation - Completed Already 2 - MSYS2 system update -Successful now after proxy update 3 - MSYS2 and MINGW development toolchain -Successful now after proxy update