# salt.states.rbenv

## Managing Ruby installations with rbenv

This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time it is needed and can be updated later. This module will not automatically install packages which rbenv will need to compile the versions of ruby. If your version of ruby fails to install, refer to the ruby-build documentation to verify you are not missing any dependencies: https://github.com/rbenv/ruby-build/wiki

If rbenv is run as the root user then it will be installed to /usr/local/rbenv, otherwise it will be installed to the users ~/.rbenv directory. To make rbenv available in the shell you may need to add the rbenv/shims and rbenv/bin directories to the users PATH. If you are installing as root and want other users to be able to access rbenv then you will need to add RBENV_ROOT to their environment.

The following state configuration demonstrates how to install Ruby 1.9.x and 2.x using rbenv on Ubuntu/Debian:

    rbenv-deps:
      pkg.installed:
        - names:
          - bash
          - git
          - openssl
          - libssl-dev
          - make
          - curl
          - autoconf
          - bison
          - build-essential
          - libffi-dev
          - libyaml-dev
          - libreadline6-dev
          - zlib1g-dev
          - libncurses5-dev

    ruby-1.9.3-p429:
      rbenv.absent:
        - require:
          - pkg: rbenv-deps

    ruby-2.0.0-p598:
      rbenv.installed:
        - default: True
        - require:
          - pkg: rbenv-deps

salt.states.rbenv.absent(name, user=None)

  Verify that the specified ruby is not installed with rbenv. Rbenv is installed if necessary.

  name

    The version of ruby to uninstall

  user: None

    The user to run rbenv as.

    Added in version 0.17.0.

  Added in version 0.16.0.

salt.states.rbenv.install_rbenv(name, user=None)

  Install rbenv if not installed. Allows you to require rbenv be installed prior to installing the plugins. Useful if you want to install rbenv plugins via the git or file modules and need them installed before installing any rubies.

  Use the rbenv.root configuration option to set the path for rbenv if you want a system wide install that is not in a user home dir.

  user: None

    The user to run rbenv as.

salt.states.rbenv.installed(name, default=False, user=None)

  Verify that the specified ruby is installed with rbenv. Rbenv is installed if necessary.

  name

    The version of ruby to install

  defaultFalse

    Whether to make this ruby the default.

  user: None

    The user to run rbenv as.

    Added in version 0.17.0.

  Added in version 0.16.0.