For automation, it's often best to use packages rather than mess with meta-tools like rbenv
and rvm
which can be very brittle when not used manually by a single user. So, this tiny project makes creating ruby packages super simple.
This project currently targets Ubuntu 14.04.
First, make sure the variable RUBY_BUILD_VERSION
is up-to-date in the Vagrantfile
. The version should correspond to an available ruby version on the official ruby source download site.
vagrant up
This will automatically run the build process for whichever RUBY_BUILD_VERSION
you specified. The *.deb
package generated will appear in this directory when the task is completed. Then you can commit the package, or copy it somewhere else.
For example:
> ls -lh
total 139304
-rw-r--r-- 1 dev staff 1K Jan 14 18:37 README.md
-rw-r--r-- 1 dev staff 2.5K Jan 14 18:36 Vagrantfile
-rw-r--r-- 1 dev staff 27M Jan 14 18:36 ruby-2.2.4_1_amd64.deb
-rw-r--r-- 1 dev staff 41M Jan 14 18:30 ruby-2.3.0_1_amd64.deb
If the VM is already running and you would like to build a new ruby package, do this:
vagrant provision
If there is a security update or other improvement that does not trigger a version number change, then modify the -v 1
part of the fpm
command to be -v 2
(or higher). That increases the version number for the package so that apt-get will know to replace the older package on your system when you update it.