cookbook 'gem_installation', '= 2.0.1', :supermarket
gem_installation (3) Versions 2.0.1 Follow0
Installs ruby gems and their dependencies
cookbook 'gem_installation', '= 2.0.1'
knife cookbook site install gem_installation
knife cookbook site download gem_installation
Provides a set of LWRPs to install ruby gems and/or their package dependencies, before or during convergence.
If you are sick and tired of manually installing libxml2-dev and libxslt-dev, this cookbook is dedicated to you.
Does not install the rubygems binary.
You probably don't want to use this, it's not well done and semi abandoned, but I haven't found a better solution yet.
Update notes from previous versions
- You must include the
gem_installation::defaultrecipe now. This is the sad result of some internal rejiggering
Currently, the prerequisites are hardcoded in libraries/gem_installation.rb
While a solution utilizing a dependency resolver would be great, for now this is much better than nothing, and the LWRP interface is unlikely to change anyway.
Ubuntu and Debian. Check .kitchen.yml for the exact versions tested.
# Set up everything this cookbook needs include_recipe "gem_installation::default" # Install fog before convergence so you can use it in your chef recipes gem_installation "fog" # Install fog during convergence gem_installation "nokogiri" do action :install end # Install the nokogiri dependencies during convergence (e.g. because you deploy a Ruby application that has nokogiri in it's bundle). # Note: does not install nokogiri itself, only the dependencies gem_installation_dependencies "nokogiri" # Install fog dependencies before convergence (e.g. because you include a third party cookbook that will install fog as a chef_gem). # Once again, the fog gem itself is not installed gem_installation_dependencies "fog" do action :install_before_convergence end
Installs the deep_merge gem, which this cookbook depends on.
Also includes build-essential, so you're able to build native extensions.
Currently, no attributes are used by this cookbook.
Resources / Providers
Note that the default actions for the two LWRPs are the opposite of each other.
While this is inconsistent, it reflects the expected use cases.
Deals with gem installation, including dependencies
|gem_name||Name of the gem to install||String||name|
|install_before_convergence||Installs the named gem as a chef_gem||yes|
|install||Installs the named gem using gem_package|
Install only gem dependencies, not the gems themselves.
|gem_name||Dependencies of this gem will be installed||String||name|
|install||Installs prerequisites during convergence||yes|
|install_before_convergence||Installs prerequisites before convergence|
- Now installs build-essential at compile time
2.0.1 passed this metric
2.0.1 passed this metric