cookbook 'ruby-install', '= 0.1.0'
ruby-install (4) Versions 0.1.0 Follow3
Installs postmodern's ruby-install and optionally Ruby versions.
cookbook 'ruby-install', '= 0.1.0', :supermarket
knife supermarket install ruby-install
knife supermarket download ruby-install
ruby-install Chef cookbook
Installs postmodern's ruby-install
and optionally Ruby versions.
Dependencies
- git
Recipes
ruby-install::default
This default recipe will install ruby-install.
Using the git_url
attribute it will download a Git repository.
The git_ref
will allow you to select a version.
Please select one of the tags from the
original repository.
ruby-install::install
This recipe will also use ruby-install to install rubies.
One or more can be specified using the attributes.
The same can be accomplished by using the ruby_install_ruby
provider
(which this recipe uses).
The ruby_install_ruby
provider accepts more
configurable options than the recipe does, so if you need any of them;
use the provider. More information in the providers section.
Attributes
All attributes are scoped within the ruby-install
node attribute.
See also example below.
-
git_url
- String - Optional - Default:https://github.com/postmodern/ruby-install.git
-
git_ref
- String - Optional - Default:v0.3.4
-
install_path
- String - Optional - Defaults to:/var/chef/cache/ruby-install
Path to installruby-install
in.
(Default value uses thefile_cache_path
attribute from Chef's config.) -
rubies
- Array - Default: []
Each array element is a Hash with the following attributes:-
ruby
- String - Required -ruby-install
specific Ruby version selector.
Examples:ruby
,ruby 2.0.0-p353
orrubinius stable
.
Keywords such as stable are supported but not recommended. Seeruby_install_ruby
provider for more information. -
user
- String - Optional - User for which to install the Ruby version.
If used, make sure that the user is allowed to write in the default directories, if you use them, and if the user is allowed to allowruby-install
to install packages. -
group
- String - Optional - Group for which to install the Ruby version. -
reinstall
- Boolean - Optional - Default:false
Set totrue
to reinstall the ruby. -
gems
- Array - Optional - Default:[]
Each array element is a Hash with the following attributes: -
name
- Required - Name of the gem to install. -
version
- Optional - Version of the gem to install. - Other gem install options are not supported by chef's
gem_package
.
-
Example:
{ "ruby-install" => { git_url: "https://github.com/postmodern/ruby-install.git", git_ref: "v0.3.4", install_path: "/home/vagrant/ruby-install", rubies: [ { ruby: "ruby 2.0.0-353", user: "vagrant", group: "vagrant", reinstall: true, gems: [ { name: "bundler", version: "1.5.1" } ] } ] } }
Resources and Providers
ruby_install_ruby
This provider installs rubies using ruby-install.
Actions
Install
Installs the Ruby specified using ruby-install.
Reinstall
Tells ruby-install to reinstall the ruby.
Attributes
-
ruby
- String - ruby-install specific Ruby version selector.
Examples:ruby
,ruby 2.0.0-p353
orrubinius 2.1.1
.
Keywords such as stable are not recommended as their actual version change with each release. -
gems
- Array - List of gems to install.
Each array element is a hash that specify which gems to install. See theruby-install::install
recipe for the format of each hash. -
user
- String - User for which to install the Ruby version. -
group
- String - Group for which to install the Ruby version. -
environment
- Hash - environment variables to be set.
The following are ruby-install
specific options. If no value is specified
it will use the ruby-install default
.
However, src_dir
and install_dir
are the only two exceptions to this.
See the exceptions heading under the list.
-
src_dir
- String - Optional
Directory to download source-code into. -
install_dir
- String - Optional
Directory to install Ruby into. -
patch
- String - Optional
Patch to apply to the Ruby source-code. -
mirror
- String - Optional
Alternate mirror to download the Ruby archive from. -
url
- String - Optional
Alternate URL to download the Ruby archive from. -
md5
- String - Optional
MD5 checksum of the Ruby archive. -
no-download
- Boolean - Optional - Defaultfalse
Use the previously downloaded Ruby archive -
no-verify
- Boolean - Optional - Defaultfalse
Do not verify the downloaded Ruby archive -
no-install-deps
- Boolean - Optional - Defaultfalse
Do not install build dependencies before installing Ruby -
no-reinstall
- Boolean - Optional - Defaultfalse
Skip installation if another Ruby is detected in same location.
Exceptions:
-
src-dir
is set the the users home dir$HOME/rubies-src
ifuser
is specified. -
install_dir
is always set so that the provider can call it to install gems and update the path if specified. It will default to$HOME/.rubies/$RUBY
for a user install and/opt/rubies/$RUBY
for a system install.$RUBY
is the ruby string you specified with the spacesreplaced with dashes
-
.
License
This cookbook is released under the MIT License.
See the bundled LICENSE file for details.