cookbook 'rvm_fw', '= 0.2.0'
rvm_fw (11) Versions 0.2.0 Follow0
Installs common ruby packages and RVM via RVM::FW
cookbook 'rvm_fw', '= 0.2.0', :supermarket
knife supermarket install rvm_fw
knife supermarket download rvm_fw
rvm_fw Cookbook
This is a very opinionated and simple cookbook for utilizing an RVM::FW server instance and installing a default Ruby via RVM.
Requirements
packages
-
build_essential
- RVM needs compiling tools to install ruby from source
Attributes
rvm_fw::default
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['rvm_fw']['path']</tt></td>
<td>String</td>
<td>prefix for where to install RVM</td>
<td><tt>'/usr/local/rvm'</tt></td>
</tr>
<tr>
<td><tt>['rvm_fw']['sudo']</tt></td>
<td>Boolean</td>
<td>Use sudo to install RVM server-wide</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td><tt>['rvm_fw']['url']</tt></td>
<td>String</td>
<td>RVM::FW server URL (with protocol)</td>
<td><tt>nil</tt></td>
</tr>
<tr>
<td><tt>['rvm_fw']['version']</tt></td>
<td>String</td>
<td>RVM::FW RVM installer version</td>
<td><tt>'1.18.14'</tt></td>
</tr>
<tr>
<td><tt>['rvm_fw']['global_ruby']</tt></td>
<td>String</td>
<td>Global ruby version to install via RVM</td>
<td><tt>'ruby-2.2.2'</tt></td>
</tr>
</table>
Usage
rvm_fw::default
Include rvm_fw
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[rvm_fw]" ] }
Notes
Using RVM installed Ruby Binaries
RVM automatically generates wrappers for each ruby installed through it. These
wrapper binaries are perfect cronjobs, library dependencies, etc.
Binaries are found in the following location:
#{node['rvm_fw']['path']/wrappers/default
And are available for the following commands:
- ruby
- gem
- rake
- irb
- rdoc
- ri
- erb
- testrb
Testing Notes
In order to test this cookbook in its current form you'll need to setup your own RVM::FW instance and add the URL to the ['rvm_fw']['url']
attribute.
Tests are currently integration tests with test-kitchen:
bundle exec kitchen test
Kitchen tests are non-functional for debian platform systems. Not sure why yet. For now run the following:
bundle exec kitchen converge
You can verify that everything works as expected with the following:
bundle exec kitchen login <platform> sudo su - # Run the following to verify the cookbook works as expected rvm --version ruby --version gem list bundler
Fedora (and possibly older RHEL distributions):
On Fedora (with test kitchen) you may need to negate requiretty
:
$ visudo # Change this line: Defaults requiretty # To this line: Defaults !requiretty
If this occurs in your environment you'll need to configure your sudoers file prior to the rvm_fw cookbook running as it is outside the scope of this cookbook to make assumptions about your sudoers file.
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Add specs for your feature
- Write your change
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
Authors: Steven Haddox
Dependent cookbooks
build-essential ~> 2.2 |
apt ~> 2.7.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
rvm_fw CHANGELOG
This file is used to list changes made in each version of the rvm_fw cookbook.
0.1.0
- [Steven Haddox] - Initial release of rvm_fw
Foodcritic Metric
0.2.0 failed this metric
FC031: Cookbook without metadata file: /tmp/cook/6191f4b3e31e3318d7a592d7/rvm_fw/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/6191f4b3e31e3318d7a592d7/rvm_fw/metadata.rb:1
0.2.0 failed this metric
FC045: Consider setting cookbook name in metadata: /tmp/cook/6191f4b3e31e3318d7a592d7/rvm_fw/metadata.rb:1