Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby on the same box.
http://misheska.com/blog/2013/06/15/using-rbenv-to-manage-multiple-versions-of-ruby/
New in version 0.16.0.
Returns or sets the currently defined default ruby
The version to set as the default. Should match one of the versions
listed by rbenv.versions
.
Leave blank to return the current default.
CLI Example:
salt '*' rbenv.default
salt '*' rbenv.default 2.0.0-p0
Execute a ruby command with rbenv's shims from the user or the system
CLI Example:
salt '*' rbenv.do 'gem list bundler'
salt '*' rbenv.do 'gem list bundler' deploy
Execute a ruby command with rbenv's shims using a specific ruby version
CLI Example:
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler'
salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' runas=deploy
Install rbenv systemwide
CLI Example:
salt '*' rbenv.install
Install a ruby implementation.
The version of Ruby to install, should match one of the
versions listed by rbenv.list
The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running.
Additional environment variables can be configured in pillar / grains / master:
rbenv:
build_env: 'CONFIGURE_OPTS="--no-tcmalloc" CFLAGS="-fno-tree-dce"'
CLI Example:
salt '*' rbenv.install_ruby 2.0.0-p0
Check if rbenv is installed
CLI Example:
salt '*' rbenv.is_installed
List the installable versions of ruby
The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running.
CLI Example:
salt '*' rbenv.list
Run rbenv rehash
to update the installed shims
The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running.
CLI Example:
salt '*' rbenv.rehash
Uninstall a ruby implementation.
The version of ruby to uninstall. Should match one of the versions
listed by rbenv.versions
.
The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running.
CLI Example:
salt '*' rbenv.uninstall_ruby 2.0.0-p0
Updates the current versions of rbenv and ruby-build
The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running.
CLI Example:
salt '*' rbenv.update
List the installed versions of ruby
CLI Example:
salt '*' rbenv.versions