Installs ruby with the help of the ruby-install tool. Just provide a ruby version number (and optionally the ruby edition, see below) and this role will take care of the rest.
Does a clean ruby install by downloading and compiling ruby (no rvm/rbenv/chruby/package repo business),
see ruby-install. Once installed the ruby version is linked from /usr/local/bin
to make it the system wide default version. So this role is most practical for server installation where you don't have the
need to juggle multiple ruby versions on the same machine.
This role also installs the bundler gem for you. So you are ready to go right away!
Based on the two existing ansible roles:
Tested only on Ubuntu 14.04 Trusty Server. Supports only Ubuntu and perhaps Debian based systems (apt).
- ruby_version_string: Edition and version of ruby you want to have installed. Default to ruby (MRI) 2.2.3.
So you can either just do a version like
2.2.1
if you want just standard (MRI) ruby. Or prepend the version with a edition. For examplejruby-1.7
Optionally you can also specify the version of the ruby-install script
with ruby_install_version
.
See more (less relevant) variables you can modify in defaults/main.yml
.
Needs no other Ansible roles to run.
Example Playbook integration:
- hosts: servers
roles:
{ role: mediapeers.ruby, ruby_version_string: 2.2.3 }
Also works with jruby (or any ruby that ruby-install supports).
Example: ruby_version_string: jruby-1.7.21
. So the version directive works like the one found in .ruby-version
files.
MIT License. As I based my work on above metioned projects. See LICENSE file for full text.