Engine Yard Blog RSS Feed

Stable RVM has been available for some time now. Many of you may know what goes on in RVM, but there is still a story to tell.

RVM is now using git flow, following the model outlined here, which makes a diametrical change in the release model of RVM. We will no longer make small releases using the master branch. We will have rare larger releases (called latest). Even so, we will maintain a stable branch which gets only fixes and important updates like ruby version updates. This new release model will allow for development of new features in head whilst keeping a stable version of RVM available for production use.

To install stable RVM:

$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

To update stable rvm:

$ rvm get stable # the same as:
$ rvm get branch wayneeseguin/stable

It is also possible to use your own fixes for rvm, which is especially useful for contributors. They can test their work or ask someone else to test their work before sending a pull request. Simply fork the project, add your changes, commit, push and then anyone can install / update to your fork:

$ rvm get branch mpapis/master

RVM now provides information about the age of the installation, in order to see exactly how old the installation is, we can run:

$ rvm info rvm
rvm:
version:      "rvm 1.10.0 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]"
updated:      "2 hours 52 minutes 49 seconds ago"

Significant changes to the output formatting of RVM should be noted—especially the installation and get / notes actions. RVM now displays less information and more readable output when it is installed and updated. The command rvm notes displays all of the important notes that were previously displayed in installation / update process. Updating rvm will now display only the newest updates for notes, so it is not required to run rvm notes after every installation:

$ rvm get head
...
Upgrade Notes:
* If you see the following error message: Unknown alias name: 'default'
re-set your default ruby, this is due to a change in how default works.
...

If we run it again directly afterwards, we will see that there are no new notes:

$ rvm get head
...
Upgrade Notes:
* No new notes to display.
...

Another recent but useful change is the automatic execution of rvm reload after rvm get ...:

$ rvm get head
...
RVM reloaded!

Important Changes

The practice of use-ing rubies from binary has confused a lot of new and experienced users alike. When RVM is loaded as a shell function and calls a binary script instead of a function, the ruby does not become active. This is because external commands or ‘binaries' cannot affect the environment in which they are called. Currently when rvm is called as a binary (not a function) it will print a warning:

$ command rvm use 1.9.3
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
$ rvm use 1.9.3
Using /home/mpapis/.rvm/gems/ruby-1.9.3-p0

It was often useful in scripts to call the binary with the --default switch to make a given ruby the default. The new way to accomplish this is to explicitly create the default alias (which is what was done in background for the --default flag):

$ rvm alias create default <version>

RVM will no longer install a new ruby if it is already present:

$ rvm install 1.9.3

To make a clean re-install we must now use the reinstall action:

$ rvm reinstall 1.9.3

The old behavior of installation directly over top (not cleaning the sources beforehand) is still available with the --force flag:

$ rvm install 1.9.3 --force

As there were a lot of fixes in rvm, some changes require updating your system files. To update these files, use the --auto switch. This is very handy, especially for multi-user installations—also called ‘root' or ‘system' installations—as it will update the files in /etc to provide the latest settings from RVM:

$ rvm get head --auto

Another important change is added third installation type for rvm - mixed mode, now every user can decide to use his private rubies/gemsets:

$ rvm user [gemsets/all]

On Linux, it is also now possible for sysadmins to define rvm configuration by default for all new users that will be created with the --skel flag (which updates /etc/skel):

$ sudo rvm user [gemsets/all] --skel

The goal of RVM has always been to make the job of managing different ruby versions easier. To further this cause, we have implemented a few new installation switches:For setting default mode on JRuby / Rubinius there are --18 and --19flags:

$ rvm install rbx --19   # will install Rubunius with default mode set to 1.9
$ rvm install jruby --18 # will install JRuby with default mode set to 1.8

For compiling 32 bit mode ruby on OS X we have --32, --64 and --universal flags:

$ rvm install 1.9.3 --universal # to build fat binary including both 32 and 64 bit binaries
$ rvm install 1.8.7 --32 # to build only 32 bit ruby
$ rvm install 1.8.7 --with-arch=i386 # is equivalent to the 32 bit one, but is available only via RVM, ruby 1.8.7 sources do not support it.

For named rubies there is additional validation to help avoid naming issues; only valid names will be allowed for installation:

$ rvm install 1.8.7 --32 -n 32 # will fail
$ rvm install 1.8.7 --32 -n n32 # will work
$ rvm install 1.8.7-n32 --32 # equivalent of the above

Last but not least, RVM has reworked display-color management. RVM by default will now show colored outputs on the console and disables colors when there is no terminal attached. Colors can be also disabled with an environment variable or command line switch:

$ rvm list         # will show the colored list by default in terminal
$ rvm --color=force list | less -R         # will show the colored list in less
$ rvm_pretty_print_flag=auto rvm list | tee my-rubies.list         # will automatically disable colors
$ rvm --color=no list         # will always disable colors

But wait! There's More! Act now and you OS X users can have a shiny new tool! The official RVM GUI JewelryBox, version 1.2, has been released! It now supports all of the RVM changes we have mentioned above!


Tagged:

comments powered by Disqus