I am somewhat new to chocolatey, having installed a few packages in the past on Windows 8, and I have come to like it.
I have noticed that chocolatey installs the packages in the default Windows program directory (i.e. "Program Files x86" or so). Maybe there is more to that that I am missing.
For the specific case of Ruby 2.1.5 and Ruby DevKit, I have a couple of questions:
I know there is some information about changing the install directory, but the arguments syntax are dependent on the install system used (if any) by the specific package being installed, in this case, Ruby & Ruby DevKit. I am yet to find what would be the CLI installation string for ruby and ruby devkit on windows. Any help is greatly appreciated. Thanks
Parts of Ruby, coming from *nix, do not like spaces. Gems is one of them. This is not a Chocolatey thing, just an FYI in case you DO run into issues once you put it into Program Files. It likely won't work there, so if you run into problems, move it somewhere else.
The installer also doesn't really update permissions if I recall correctly, so you are on your own to make sure your permissions are good so you can run it e.g. Program Files is Administrators writeable only, which you won't have unless you are running an administrative prompt (this is UAC, it removes you from the Administrators group in non-elevated processes).
If you are on a 64-bit system and a package has x64 urls in it, you will get the 64-bit version of that software unless you specifically use -x86
to force the 32-bit version.
$url64
, so we are good):Install-ChocolateyPackage "$packageId" 'exe' "$silentArgs" "$url" "$url64" -checksum $checksum -checksum64 $checksum64
Get-ChocolateyWebFile 'ruby2.devkit' "$file" -url "$url" -url64bit "$url64" -checksum "$checksum" -checksum64 "$checksum64" -checksumType "$checksumType"
Usually you would pass the native switch for changing the directory through installargs
. However these packages, due to the known issues above, use Chocolatey's Get-BinRoot
to determine where to install themselves.
Get-BinRoot
uses an environment variable named ChocolateyBinRoot
(set by default to $env:SystemDrive\tools
) to determine where to put certain software that doesn't really qualify for Program Files. You can set that where ever you want, including Program Files folders and it will use that location instead.
choco install ruby -version 2.1.5
refreshenv
otherwise close and reopen shell.choco install ruby2.devkit
(note the ruby2)config.yml
in the DevKit folder to see if it picked up the ruby installation, otherwise set it and run ruby dk.rb install
(you may need force) in the devkit folder to install it into ruby. For more info, please see DevKit.refreshenv
otherwise close and reopen shell.