cookbook 'ruby_rbenv', '= 1.1.0'
ruby_rbenv
(53) Versions
1.1.0
-
-
5.0.22
-
5.0.21
-
5.0.20
-
5.0.19
-
5.0.18
-
5.0.17
-
5.0.16
-
5.0.15
-
5.0.14
-
5.0.13
-
5.0.12
-
5.0.11
-
5.0.10
-
5.0.9
-
5.0.8
-
5.0.7
-
5.0.6
-
5.0.5
-
5.0.4
-
5.0.3
-
5.0.2
-
5.0.1
-
5.0.0
-
4.0.1
-
4.0.0
-
3.0.0
-
2.6.0
-
2.5.1
-
2.5.0
-
2.4.0
-
2.3.2
-
2.3.1
-
2.3.0
-
2.2.0
-
2.1.3
-
2.1.2
-
2.1.1
-
2.1.0
-
2.0.9
-
2.0.8
-
2.0.7
-
2.0.6
-
2.0.5
-
2.0.4
-
2.0.3
-
2.0.2
-
2.0.1
-
2.0.0
-
1.2.1
-
1.2.0
-
1.1.0
-
1.0.1
-
1.0.0
Follow18
- 5.0.22
- 5.0.21
- 5.0.20
- 5.0.19
- 5.0.18
- 5.0.17
- 5.0.16
- 5.0.15
- 5.0.14
- 5.0.13
- 5.0.12
- 5.0.11
- 5.0.10
- 5.0.9
- 5.0.8
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.1
- 4.0.0
- 3.0.0
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
Manages rbenv and installs Rbenv based Rubies
cookbook 'ruby_rbenv', '= 1.1.0', :supermarket
knife supermarket install ruby_rbenv
knife supermarket download ruby_rbenv
<a name="title"></a> ruby_rbenv Chef Cookbook
<a name="description"></a> Description
Manages rbenv and its installed Rubies.
Several lightweight resources and providers (LWRPs) are also defined.
WARNING: As of version 1.0 this cookbook was renamed from rbenv to ruby_rbenv so it could be uploaded to the Supermarket. Attributes and resources (LWRPs) retain the rbenv namespace for compatibility, but if you wrap this cookbook you'll need to update the recipes you include. Use 0.9.0 if you need the existing name.
<a name="requirements"></a> Requirements
<a name="requirements-chef"></a> Chef
This cookbook requires Chef 12.1+.
<a name="requirements-platform"></a> Platform
The following platforms have been tested with this cookbook, meaning that
the recipes and LWRPs run on these platforms without error:
- Arch
- Debian derivitives (Debian 7+, Ubuntu 10.04+, Linux Mint)
- Freebsd
- Fedora
- Gentoo
- Mac OS X
- RHEL deritivites (RHEL, CentOS, Amazon Linux, Oracle, Scientific Linux)
Please report any additional platforms so they can be added.
<a name="requirements-cookbooks"></a> Cookbooks
- ruby_build cookbook
- java cookbook if installing jruby (recommended, but not required in the metadata)
<a name="usage"></a> Usage
<a name="usage-system-rubies"></a> rbenv Installed System-Wide with Rubies
Most likely, this is the typical case. Include recipe[ruby_rbenv::system]
in your
run_list and override the defaults you want changed. See below
for more details.
If your platform is the Mac, you may need to modify your
profile.
<a name="usage-user-rubies"></a> rbenv Installed For A Specific User with Rubies
If you want a per-user install (like on a Mac/Linux workstation for
development, CI, etc.), include recipe[ruby_rbenv::user]
in your run_list and
add a user hash to the user_installs
attribute list. For example:
node.default['rbenv']['user_installs'] = [
{ 'user' => 'tflowers',
'rubies' => ['1.9.3-p0', 'jruby-1.6.5'],
'global' => '1.9.3-p0',
'gems' => {
'1.9.3-p0' => [
{ 'name' => 'bundler',
'version' => '1.1.rc.5'
},
{ 'name' => 'rake' }
],
'jruby-1.6.5' => [
{ 'name' => 'rest-client' }
]
}
}
]
See below for more details.
<a name="usage-system"></a> rbenv Installed System-Wide and LWRPs Defined
If you want to manage your own rbenv environment with the provided
LWRPs, then include recipe[ruby_rbenv::system_install]
in your run_list
to prevent a default rbenv Ruby being installed. See the
Resources and Providers section for more details.
If your platform is the Mac, you may need to modify your
profile.
<a name="usage-user"></a> rbenv Installed For A Specific User and LWRPs Defined
If you want to manage your own rbenv environment for users with the provided
LWRPs, then include recipe[ruby_rbenv::user_install]
in your run_list and add a
user hash to the user_installs
attribute list. For example:
node.default['rbenv']['user_installs'] = [
{ 'user' => 'tflowers' }
]
See the Resources and Providers section for more details.
<a name="usage-minimal"></a> Ultra-Minimal Access To LWRPs
Simply include recipe[ruby_rbenv]
in your run_list and the LWRPs will be
available to use in other cookbooks. See the Resources and Providers
section for more details.
<a name="recipes"></a> Recipes
<a name="recipes-default"></a> default
Installs the rbenv gem and initializes Chef to use the Lightweight Resources
and Providers (LWRPs).
Use this recipe explicitly if you only want access to the LWRPs provided.
<a name="recipes-system-install"></a> system_install
Installs the rbenv codebase system-wide (that is, into /usr/local/rbenv
). This
recipe includes default.
Use this recipe by itself if you want rbenv installed system-wide but want
to handle installing Rubies, invoking LWRPs, etc..
<a name="recipes-system"></a> system
Installs the rbenv codebase system-wide (that is, into /usr/local/rbenv
) and
installs rubies driven off attribute metadata. This recipe includes default
and system_install.
Use this recipe by itself if you want rbenv installed system-wide with rubies
installed.
<a name="recipes-user-install"></a> user_install
Installs the rbenv codebase for a list of users (selected from the
node['rbenv']['user_installs']
hash). This recipe includes default.
Use this recipe by itself if you want rbenv installed for specific users in
isolation but want each user to handle installing Rubies, invoking LWRPs, etc.
<a name="recipes-user"></a> user
Installs the rbenv codebase for a list of users (selected from the
node['rbenv']['user_installs']
hash) and installs rubies driven off attribte
metadata. This recipe includes default and user_install.
Use this recipe by itself if you want rbenv installed for specific users in
isolation with rubies installed.
<a name="attributes"></a> Attributes
<a name="attributes-git-url"></a> git_url
The Git URL which is used to install rbenv.
The default is "git://github.com/sstephenson/rbenv.git"
.
<a name="attributes-git-ref"></a> git_ref
A specific Git branch/tag/reference to use when installing rbenv. For
example, to pin rbenv to a specific release:
node.default['rbenv']['git_ref'] = "v0.2.1"
The default is "v0.4.0"
.
<a name="attributes-upgrade"></a> upgrade
Determines how to handle installing updates to the rbenv. There are currently
2 valid values:
-
"none"
,false
, ornil
: will not update rbenv and leave it in its current state. -
"sync"
ortrue
: updates rbenv to the version specified by thegit_ref
attribute or the head of the master branch by default.
The default is "none"
.
<a name="attributes-root-path"></a> root_path
The path prefix to rbenv in a system-wide installation.
The default is "/usr/local/rbenv"
.
<a name="attributes-patch_url"></a> patch_url
A url to a patch file for your ruby install.
The default is nil
.
<a name="attributes-patch_file"></a> patch_file
A path to a patch file for your ruby install.
The default is nil
.
<a name="attributes-rubies"></a> rubies
A list of additional system-wide rubies to be built and installed using the
ruby_build cookbook. You must include recipe[ruby_build]
in your run_list for the rbenv_ruby
LWRP to work properly. For example:
node.default['rbenv']['rubies'] = [ "1.9.3-p0", "jruby-1.6.5" ]
The default is an empty array: []
.
Additional environment variables can be passed to ruby_build via the environment variable.
For example:
node.default['rbenv']['rubies'] = [ "1.9.3-p0", "jruby-1.6.5",
{
:name => '1.9.3-327',
:environment => { 'CFLAGS' => '-march=native -O2 -pipe' }
}
]
<a name="attributes-plugins"></a> plugins
A list of plugins to be installed into the system (or user) install of rbenv.
Provide a hash of name and git_url for each plugin to be installed, with optional revision.
node.default['rbenv']['plugins'] = [
{
:name => "rbenv-vars",
:git_url => 'git://github.com/sstephenson/rbenv-vars.git'
},
{
:name => 'rbenv-update',
:git_url => 'git://github.com/rkh/rbenv-update.git',
:revision => 'master'
} ]
The same applies for user_installs.
<a name="attributes-user-rubies"></a> user_rubies
A list of additional system-wide rubies to be built and installed (using the
ruby_build cookbook) per-user when not explicitly set.
For example:
node.default['rbenv']['user_rubies'] = [ "1.8.7-p352" ]
The default is an empty array: []
.
Additional environment variables can be passed to ruby_build via the environment variable.
For example:
node.default['rbenv']['user_rubies'] = [ "1.8.7-p352",
{
:name => '1.9.3-327',
:environment => { 'CFLAGS' => '-march=native -O2 -pipe' }
}
]
<a name="attributes-gems"></a> gems
A hash of gems to be installed into arbitrary rbenv-managed rubies system wide.
See the rbenv_gem resource for more details about the options
for each gem hash and target Ruby environment. For example:
node.default['rbenv']['gems'] = {
'1.9.3-p0' => [
{ 'name' => 'vagrant' },
{ 'name' => 'bundler'
'version' => '1.1.rc.5'
}
],
'1.8.7-p352' => [
{ 'name' => 'nokogiri' }
]
}
The default is an empty hash: {}
.
<a name="attributes-user-gems"></a> user_gems
A hash of gems to be installed into arbitrary rbenv-managed rubies for each user
when not explicitly set. See the rbenv_gem resource for more
details about the options for each gem hash and target Ruby environment. See
the gems attribute for an example.
The default is an empty hash: {}
.
<a name="attributes-plugins"></a> plugins
A list of plugins to be installed system-wide. See the rbenv_plugin
resource for details about the options.
node.default['rbenv']['plugins'] = [
{ 'name' => 'rbenv-vars',
'git_url' => 'https://github.com/sstephenson/rbenv-vars.git' },
{ 'name' => 'rbenv-gem-rehash',
'git_url' => 'https://github.com/sstephenson/rbenv-gem-rehash.git',
'git_ref' => '4d7b92de4' }
]
The default is an empty array: []
.
<a name="attributes-user-gems"></a> user_plugins
As with user_gems, a list of plugins to be installed for each user when not explicitly set.
The default is an empty array: []
.
<a name="attributes-vagrant-system-chef-solo"></a> vagrant/system_chef_solo
If using the vagrant
recipe, this sets the path to the package-installed
chef-solo binary.
The default is "/opt/ruby/bin/chef-solo"
.
<a name="attributes-create-profiled"></a> create_profiled
The user's shell needs to know about rbenv's location and set up the
PATH environment variable. This is handled in the
system_install and
user_install recipes by dropping off
/etc/profile.d/rbenv.sh
. However, this requires root privilege,
which means that a user cannot use a "user install" for only their
user.
Set this attribute to false
to skip creation of the
/etc/profile.d/rbenv.sh
template. For example:
node.default['rbenv']['create_profiled'] = false
The default is true
.
<a name="lwrps"></a> Resources and Providers
<a name="lwrps-rg"></a> rbenv_global
This resource sets the global version of Ruby to be used in all shells, as per
the rbenv global docs.
<a name="lwrps-rg-actions"></a> Actions
<table>
<thead>
<tr>
<th>Action</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>create</td>
<td>
Sets the global version of Ruby to be used in all shells. See 3.1
rbenv global<sup>(1)</sup> for more details.
</td>
<td>Yes</td>
</tr>
</tbody>
</table>
<a name="lwrps-rg-attributes"></a> Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>rbenv_version</td>
<td>
<b>Name attribute:</b> a version of Ruby being managed by rbenv.
<b>Note:</b> the version of Ruby must already be installed--this LWRP
will not install it automatically.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>user</td>
<td>
A users's isolated rbenv installation on which to apply an action. The
default value of <code>nil</code> denotes a system-wide rbenv
installation is being targeted. <b>Note:</b> if specified, the user
must already exist.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>root_path</td>
<td>
The path prefix to rbenv installation, for example:
<code>/opt/rbenv</code>.
</td>
<td><code>nil</code></td>
</tr>
</tbody>
</table>
<a name="lwrps-rg-examples"></a> Examples
Set A Ruby As Global
rbenv_global "1.8.7-p352"
Set System Ruby As Global
rbenv_global "system"
Set A Ruby As Global For A User
rbenv_global "jruby-1.7.0-dev" do
user "tflowers"
end
<a name="lwrps-rsc"></a> rbenv_script
This resource is a wrapper for the script
resource which wraps the code block
in an rbenv-aware environment. See the Opscode
script resource page and the rbenv shell
documentation for more details.
<a name="lwrps-rsc-actions"></a> Actions
<table>
<thead>
<tr>
<th>Action</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>run</td>
<td>Run the script</td>
<td>Yes</td>
</tr>
<tr>
<td>nothing</td>
<td>Do not run this command</td>
<td> </td>
</tr>
</tbody>
</table>
Use action :nothing
to set a command to only run if another resource
notifies it.
<a name="lwrps-rsc-attributes"></a> Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>
<b>Name attribute:</b> Name of the command to execute.
</td>
<td>name</td>
</tr>
<tr>
<td>rbenv_version</td>
<td>
A version of Ruby being managed by rbenv.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>root_path</td>
<td>
The path prefix to rbenv installation, for example:
<code>/opt/rbenv</code>.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>code</td>
<td>
Quoted script of code to execute.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>creates</td>
<td>
A file this command creates - if the file exists, the command will not
be run.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>cwd</td>
<td>
Current working director to run the command from.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>environment</td>
<td>
A has of environment variables to set before running this command.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>group</td>
<td>
A group or group ID that we should change to before running this
command.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>path</td>
<td>
An array of paths to use when searching for the command.
</td>
<td><code>nil</code>, uses system path</td>
</tr>
<tr>
<td>returns</td>
<td>
The return value of the command (may be an array of accepted values) -
this resource raises an exception if the return value(s) do not match.
</td>
<td><code>0</code></td>
</tr>
<tr>
<td>timeout</td>
<td>
How many seconds to let the command run before timing out.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>user</td>
<td>
A users's isolated rbenv installation on which to apply an action. The
default value of <code>nil</code> denotes a system-wide rbenv
installation is being targeted. <b>Note:</b> if specified, the user
must already exist.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>umask</td>
<td>
Umask for files created by the command.
</td>
<td><code>nil</code></td>
</tr>
</tbody>
</table>
<a name="lwrps-rsc-examples"></a> Examples
Run A Rake Task
rbenv_script "migrate_rails_database" do
rbenv_version "1.8.7-p352"
user "deploy"
group "deploy"
cwd "/srv/webapp/current"
code %{rake RAILS_ENV=production db:migrate}
end
<a name="lwrps-rbgem"></a> rbenv_gem
This resource is a close analog of the gem_package
resource/provider which
is rbenv-aware. See the Opscode package resource and
gem package options pages for more details.
<a name="lwrps-rbgem-actions"></a> Actions
<table>
<thead>
<tr>
<th>Action</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>install</td>
<td>
Install a gem - if version is provided, install that specific version.
</td>
<td>Yes</td>
</tr>
<tr>
<td><upgrade/td>
<td>
Upgrade a gem - if version is provided, upgrade to that specific
version.
</td>
<td> </td>
</tr>
<tr>
<td>remove</td>
<td>
Remove a gem.
</td>
<td> </td>
</tr>
<tr>
<td>purge</td>
<td>
Purge a gem.
</td>
<td> </td>
</tr>
</tbody>
</table>
<a name="lwrps-rbr-attributes"></a> Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>package_name</td>
<td>
<b>Name attribute:</b> the name of the gem to install.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>rbenv_version</td>
<td>
A version of Ruby being managed by rbenv.
</td>
<td><code>"global"</code></td>
</tr>
<tr>
<td>root_path</td>
<td>
The path prefix to rbenv installation, for example:
<code>/opt/rbenv</code>.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>version</td>
<td>
The specific version of the gem to install/upgrade.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>options</td>
<td>
Add additional options to the underlying gem command.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>source</td>
<td>
Provide an additional source for gem providers (such as RubyGems).
This can also include a file system path to a <code>.gem</code> file
such as <code>/tmp/json-1.5.1.gem</code>.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>user</td>
<td>
A users's isolated rbenv installation on which to apply an action. The
default value of <code>nil</code> denotes a system-wide rbenv
installation is being targeted. <b>Note:</b> if specified, the user
must already exist.
</td>
<td><code>nil</code></td>
</tr>
</tbody>
</table>
<a name="lwrps-rbgem-examples"></a> Examples
Install A Gem
rbenv_gem "thor" do
rbenv_version "1.8.7-p352"
action :install
end
rbenv_gem "json" do
rbenv_version "1.8.7-p330"
end
rbenv_gem "nokogiri" do
rbenv_version "jruby-1.5.6"
version "1.5.0.beta.4"
action :install
end
Note: the install action is default, so the second example is a more common
usage.
Install A Gem From A Local File
rbenv_gem "json" do
rbenv_version "ree-1.8.7-2011.03"
source "/tmp/json-1.5.1.gem"
version "1.5.1"
end
Keep A Gem Up To Date
rbenv_gem "homesick" do
action :upgrade
end
Note: the global rbenv Ruby will be targeted if no rbenv_version
attribute
is given.
Remove A Gem
rbenv_gem "nokogiri" do
rbenv_version "jruby-1.5.6"
version "1.4.4.2"
action :remove
end
<a name="lwrps-plugin"></a> rbenv_plugin
Installs rbenv plugins.
<a name="lwrps-plugin-attributes"></a> Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>
<b>Name attribute:</b> the name of the plugin to install.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>root_path</td>
<td>
The path prefix to rbenv installation, for example:
<code>/opt/rbenv</code>.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>git_url</td>
<td>
The git URL of the plugin repository to clone.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>git_ref</td>
<td>
The git revision (branch name or SHA) of the repository to checkout.
</td>
<td><code>'master'</code></td>
</tr>
<tr>
<td>user</td>
<td>
A users's isolated rbenv installation on which to apply an action. The
default value of <code>nil</code> denotes a system-wide rbenv
installation is being targeted. <b>Note:</b> if specified, the user
must already exist.
</td>
<td><code>nil</code></td>
</tr>
</tbody>
</table>
Install a plugin
rbenv_plugin 'rbenv-vars' do
git_url 'https://github.com/sstephenson/rbenv-vars.git'
user 'deploy'
end
<a name="lwrps-rrh"></a> rbenv_rehash
This resource installs shims for all Ruby binaries known to rbenv, as per
the rbenv rehash docs.
<a name="lwrps-rrh-actions"></a> Actions
<table>
<thead>
<tr>
<th>Action</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>run</td>
<td>Run the script</td>
<td>Yes</td>
</tr>
<tr>
<td>nothing</td>
<td>Do not run this command</td>
<td> </td>
</tr>
</tbody>
</table>
Use action :nothing
to set a command to only run if another resource
notifies it.
<a name="lwrps-rrh-attributes"></a> Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>
<b>Name attribute:</b> Name of the command to execute.
</td>
<td>name</td>
</tr>
<tr>
<td>user</td>
<td>
A users's isolated rbenv installation on which to apply an action. The
default value of <code>nil</code> denotes a system-wide rbenv
installation is being targeted. <b>Note:</b> if specified, the user
must already exist.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>root_path</td>
<td>
The path prefix to rbenv installation, for example:
<code>/opt/rbenv</code>.
</td>
<td><code>nil</code></td>
</tr>
</tbody>
</table>
<a name="lwrps-rrh-examples"></a> Examples
Rehash A System-Wide rbenv
rbenv_rehash "Doing the rehash dance"
Rehash A User's rbenv
rbenv_rehash "Rehashing tflowers' rbenv" do
user "tflowers"
end
<a name="lwrps-rbr"></a> rbenv_ruby
This resource uses the ruby-build framework to build and install
Ruby versions from definition files.
Note: this LWRP requires the ruby_build cookbook to be
in the run list to perform the builds.
<a name="lwrps-rbr-actions"></a> Actions
<table>
<thead>
<tr>
<th>Action</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>install</td>
<td>
Build and install a Ruby from a definition file. See the ruby-build
readme<sup>(1)</sup> for more details.
</td>
<td>Yes</td>
</tr>
<tr>
<td>reinstall</td>
<td>
Force a recompiliation of the Ruby from source. The :install action
will skip a build if the target install directory already exists.
</td>
<td> </td>
</tr>
</tbody>
</table>
<a name="lwrps-rbr-attributes"></a> Attributes
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>definition</td>
<td>
<b>Name attribute:</b> the name of a built-in definition<sup>(1)</sup>
or the name of the ruby installed by a ruby-build defintion file<sup>(2)</sup>
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>definition_file</td>
<td>
The path to a ruby-build definition file.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>user</td>
<td>
A users's isolated rbenv installation on which to apply an action. The
default value of <code>nil</code> denotes a system-wide rbenv
installation is being targeted. <b>Note:</b> if specified, the user
must already exist.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>root_path</td>
<td>
The path prefix to rbenv installation, for example:
<code>/opt/rbenv</code>.
</td>
<td><code>nil</code></td>
</tr>
<tr>
<td>rbenv_action</td>
<td>
The action that rbenv takes to install ruby via the command line. By default this is 'install' which results in a command such as <code>rbenv install ruby 2.2.0</code>. When using the rvm-download rbenv plugin use 'download' to have the provider execute a command such as <code>rbenv download 2.2.0</code>.
</td>
<td><code>install</code></td>
</tr>
</tbody>
</table>
- built-in definition
- the recipe checks for the existence of the naming attribute under the root_path, and if not found invokes ruby-build with the definition file as an argument
<a name="lwrps-rbr-examples"></a> Examples
Install Ruby From ruby-build
rbenv_ruby "ree-1.8.7-2011.03" do
action :install
end
rbenv_ruby "jruby-1.6.5"
Note: the install action is default, so the second example is a more common
usage.
Reinstall Ruby
rbenv_ruby "ree-1.8.7-2011.03" do
action :reinstall
end
Install a custom ruby
rbenv_ruby "2.0.0p116" do
definition_file "/usr/local/rbenv/custom/2.0.0p116"
end
<a name="mac-system-note"></a> System-Wide Mac Installation Note
This cookbook takes advantage of managing profile fragments in an
/etc/profile.d
directory, common on most Unix-flavored platforms.
Unfortunately, Mac OS X does not support this idiom out of the box,
so you may need to modify your user profile.
<a name="development"></a> Development
- Source hosted at GitHub
- Report issues/Questions/Feature requests on GitHub Issues
Pull requests are very welcome! Make sure your patches are well tested.
Ideally create a topic branch for every separate change you make.
<a name="license"></a> License and Author
Author:: Fletcher Nichol (fnichol@nichol.ca)
Copyright 2011, Fletcher Nichol
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
1.1.0 (July 17, 2016)
- Restored compatibility for platforms that don't yet support multipackage installs in Chef (BSD and OS X in particular)
- Updated to Grab rbenv from the new repo URL and use https vs. git for compatibility
- Added missing Chefspec matchers
- Enabled use_inline_resources in all providers
- Added chef_version metadata to metadata.rb
- Added source_url and issues_url metadata to metadata.rb
- Added bash a depedency for FreeBSD
- Switched Travis testing to Kitchen Dokken
- Added a chefignore file to limit the files uploaded to the chef server
- Switched linting from Rubocop to Cookstyle (rubocop wrapper by Chef)
1.0.1 (October 24, 2015)
- Fixed failure with rehashing after the cookbook was renamed
1.0.0 (October 12, 2015)
WARNING: Cookbook has been renamed
- Renamed to ruby_rbenv and uploaded to Supermarket (all attributes rename in the rbenv cookbook). If you wrap this cookbook you're going to need to update the recipes you include. All providers have been updated to keep their existing rbenv_xyz names for backwards compatibility and attributes still maintain the rbenv namespace.
- Updated Travis config to run integration tests in Travis using kitchen-docker
0.9.0 (October 12, 2015)
- Fixed base platform case statement in the cookbook that set install_pkgs and user_home_root attributes. This has been converted to a platform_family statement to better support derivitive operating systems and the attributes are set at default levels so they can be overwritten in wrapper cookbooks
- Updated Travis to test using Chef DK vs. Gem installs
- Fixed Chefspecs and Test Kitchen bats tests to all pass
- Added the Apache 2.0 license file
- Updated and added new development dependencies to the Gemfile
- Use Chef 12.1+ multi-package installs for the dependency packages to speed up installs
- Removed the empty Vagrant recipe
- Actually depend on ruby_version vs. suggests since suggests isn't implemented in Chef
0.8.1 (August 28, 2015)
- Add rbenv_action attribute to rbenv_ruby LWRP so to allow using rvm-download rbenv plugin to download ruby vs. installing ruby
- Fix the ability to install gems to a specific version of ruby
- Remove Chef version checks around use_inline_resources since we require Chef 12
- Use default_action method in the LWRPs
- Fix various rubocop warnings
0.8.0 (July 27, 2015)
- Drop support for Chef versions prior to 12
- Add Arch linux support
- Add Linux mint support
0.7.3 (July 8, 2015)
Bug Fixes
- Issue #91 #79 #92: Add matchers for rbenv_gem and rbenv_ruby. (@tduffield and many others)
- Issue #107: "Option name must be a kind of String!" when installing gems.
- Issue #101: Use full class name for rbenv_rehash resource
- Fix undefined method `timeout' for LWRP resource rbenv_gem. (@nathantsoi and others)
- Issue #110: Chef 12.3.0 - undefined method `clear_sources' for Chef::Resource::RbenvGem. (@tatat and others)
Improvements
- Fork from https://github.com/fnichol/chef-rbenv
0.7.2 (December 31, 2012)
Bug Fixes
Improvements
- Add integration tests for a system Ruby version. (@fnichol)
0.7.1 (unreleased)
Bug Fixes
- Pull request #36: Use the ruby name as the definition to install (@gsandie)
- Pull request #55: Fix some CHEF-3694 warnings when using with ruby_build (@trinitronx)
New features
- Pull request #26: Allow setting environment vars per ruby install (@jasherai)
- Pull request #37: Allows use
include_recipe("ruby_build")
instead of having to put it in therun_list
(@tjwallace) - Pull request #42: Load rbenv environment after install (@msaffitz)
- Pull request #62: Add Gentoo as supported platform (@gentooboontoo)
Improvements
- Pull request #46: Add a
definition_file
attribute to therbenv_ruby
resource to prevent continually trying to build a custom ruby when passed a build file name instead of a built-in definition (@jf647) - Pull request #60: Support
definition_file
in rubies definition (@cyu) - Pull request #75: Update testing support and add unit tests for existing resources (@fnichol)
- Pull request #70: Support ruby 2.1.0 (@WhyEee)
0.7.0 (November 21, 2012)
Bug Fixes
New features
- Pull request #20: Set an attribute to create profile.d for user install. (@jtimberman)
Improvements
- Pull request #12: Add name attribute to metadata. (@jtimberman)
- Update foodcritic configuration and update .travis.yml. (@fnichol)
- Update Installation section of README (welcome Berkshelf). (@fnichol)
0.6.10 (May 18, 2012)
New features
Improvements
- Add other platform supports in metadata.rb and README. (@fnichol)
0.6.8 (May 6, 2012)
Improvements
- Add official hook resource log[rbenv-post-init-*] for inter-cookbook integration. (@fnichol)
0.6.6 (May 4, 2012)
Bug Fixes
- Fix FC022: Resource condition within loop may not behave as expected. (@fnichol)
- Add plaform equivalents in default attrs (FC024). (@fnichol)
- Ensure update-java-alternatives is called before JRuby is built. (@fnichol)
- Pull request #8: Add /etc/profile.d/rbenv.sh support for user installs. (@thoughtless)
Improvements
- Add TravisCI to run Foodcritic linter. (@fnichol)
- Pull request #10: README proofreading. (@jdsiegel)
- README updates. (@fnichol)
- Confirm debian platform support. (@fnichol)
0.6.4 (February 23, 2012)
Bug Fixes
- Set
root_path
on rbenv_rehash in rbenv_gem provider. (@fnichol)
Improvements
0.6.2 (February 22, 2012)
Bug Fixes
- Issues #1, #2: Stub mixins in RbenvRubygems to avoid libraries load ordering issues. (@fnichol)
- Pull request #5: Include user setting in rehash calls. (@magnetised)
- Issue #4: Fix rbenv/gems hash parsing. (@fnichol)
Improvements
- Large formatting updates to README. (@fnichol)
- Add gh-pages branch for sectioned README at https://fnichol.github.com/chef-rbenv
0.6.0 (December 21, 2011)
The initial release.
Collaborator Number Metric
1.1.0 passed this metric
Contributing File Metric
1.1.0 passed this metric
Foodcritic Metric
1.1.0 passed this metric
License Metric
1.1.0 failed this metric
ruby_rbenv does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, MIT, mit, GPL-2.0, gplv2, GPL-3.0, gplv3.
No Binaries Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 passed this metric
Version Tag Metric
1.1.0 passed this metric
1.1.0 passed this metric
1.1.0 passed this metric
Foodcritic Metric
1.1.0 passed this metric
License Metric
1.1.0 failed this metric
ruby_rbenv does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, MIT, mit, GPL-2.0, gplv2, GPL-3.0, gplv3.
No Binaries Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 passed this metric
Version Tag Metric
1.1.0 passed this metric
1.1.0 passed this metric
1.1.0 failed this metric
ruby_rbenv does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, MIT, mit, GPL-2.0, gplv2, GPL-3.0, gplv3.
No Binaries Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 passed this metric
Version Tag Metric
1.1.0 passed this metric
1.1.0 passed this metric
1.1.0 passed this metric
Version Tag Metric
1.1.0 passed this metric
1.1.0 passed this metric