Patch options to be a raw string for now
Installs and manages your versions of Ruby and Gems in Chef with rbenv and ruby_build
Add a dependency on rbenv to your cookbook’s metadata.rb
metadata.rb
depends 'rbenv'
To install rbenv and ruby_build; Include each recipe in one of your cookbook’s recipes
include_recipe "rbenv::default" include_recipe "rbenv::ruby_build"
To install rbenv-vars; Include this recipe in one of your cookbook’s recipes
include_recipe "rbenv::rbenv_vars"
And now to install a Ruby use the rbenv_ruby LWRP
rbenv_ruby
rbenv_ruby "1.9.3-p194"
If you’d like a specific Ruby installed by rbenv to include a Gem, say bundler, use the rbenv_gem LWRP
rbenv_gem
rbenv_gem "bundler" do ruby_version "1.9.3-p194" end
Be sure to include a value for the ruby_version attribute so the gem is installed for the correct Ruby
ruby_version
rbenv[:group_users]
rbenv[:git_repository]
rbenv[:git_revision]
rbenv[:install_prefix]
ruby_build[:git_repository]
ruby_build[:git_revision]
ruby_build[:prefix]
Configures a node with a system wide rbenv accessible by users in the rbenv group
Installs ruby_build to a node which enables the rbenv_ruby LWRP to install Rubies to the node
Installs an rbenv Ohai plugin onto the node to automatically populate attributes about the rbenv installation
Install specified version of Ruby to be managed by rbenv
rbenv_ruby "1.9.2-p290"
rbenv_ruby "Ruby 1.9.3" do ruby_version "1.9.3-p0" force true end
Install specified RubyGem for the specified ruby_version managed by rbenv
rbenv_gem "bundler" do ruby_version "1.9.2-p290" end
Install the prerequisite gems
$ bundle install
Increment the version number in the metadata.rb file
Run the Thor release task to create a tag and push to the community site
$ bundle exec thor release
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
rbenv cookbook
Installs and manages your versions of Ruby and Gems in Chef with rbenv and ruby_build
Requirements
Usage
Add a dependency on rbenv to your cookbook’s
metadata.rbInstalling rbenv and ruby_build
To install rbenv and ruby_build; Include each recipe in one of your cookbook’s recipes
Installing rbenv-vars
To install rbenv-vars; Include this recipe in one of your cookbook’s recipes
Installing a Ruby
And now to install a Ruby use the
rbenv_rubyLWRPInstalling Gems for rbenv managed Rubies
If you’d like a specific Ruby installed by rbenv to include a Gem, say bundler, use the
rbenv_gemLWRPBe sure to include a value for the
ruby_versionattribute so the gem is installed for the correct RubyAttributes
rbenv
rbenv[:group_users]- Array of users belonging to the rbenv grouprbenv[:git_repository]- Git url of the rbenv repository to clonerbenv[:git_revision]- Revision of the rbenv repository to checkoutrbenv[:install_prefix]- Path prefix rbenv will be installed intoruby_build
ruby_build[:git_repository]- Git url of the ruby_build repository to cloneruby_build[:git_revision]- Revision of the ruby_build repository to checkoutruby_build[:prefix]- Path prefix where ruby_build will be installed toRecipes
default
Configures a node with a system wide rbenv accessible by users in the rbenv group
ruby_build
Installs ruby_build to a node which enables the
rbenv_rubyLWRP to install Rubies to the nodeohai_plugin
Installs an rbenv Ohai plugin onto the node to automatically populate attributes about the rbenv installation
Resources / Providers
rbenv_ruby
Install specified version of Ruby to be managed by rbenv
Actions
Attributes
Examples
Installing Ruby 1.9.2-p290
Forcefully install Ruby 1.9.3-p0
rbenv_gem
Install specified RubyGem for the specified ruby_version managed by rbenv
Actions
Attributes
Examples
Installing Bundler for Ruby 1.9.2-p290
Releasing
Install the prerequisite gems
Increment the version number in the metadata.rb file
Run the Thor release task to create a tag and push to the community site
Authors and Contributors