I have been steadily increasing my use of chocolatey for installation of toolchains on Windows.
There are still a few problems, e.g. not all packages allow setting an alternate installation directory etc., but these are problems we had with the original installers as well.
There are also some version pinning issues with some packages that seem to originate on the way chocolatey provides URLs to updated packages. These lead to failures if the version is pinned and the package gets updated.
Ruby and chocolatey
Since the 2.4 version, the RubyInstaller has switched to using the newer msys2 toolchain for C extension compilation which complicated the process of automating installation via the MSI installer.
Fortunately both msys2 and the newer RubyInstallaer are available as chocolatey packages.
Unfortunately there are still some hiccups.
You have to take care to place the msys2 path entry before the Git for Windows path entry. The git installer bundles a mingw version that will mess up gem installations if detected before msys2.
Same goes for the ChefDK path entry, only this time with ruby: ChefDK bundles a ruby distro and gem installations will go array if it is found first in the path.
Chef and chocolatey
Chef provides a chocolatey_package resource and windev adds a configuration helper choco_packages for adding packages.
The following snippet will configure windev to install ruby on a windows machine:
Unfortunately, there is a bug in the interaction between Chef and chocolatey (in the choco_package resource), specific to the msys2 installation.
The installation of msys2 will hang and fail with a timeout - though msys2 will have been correctly installed. Re-run Chef and everything continues normally.
Kinda defeats the main purpose of using it with Chef, but we still get to document in code how the environment is set up.