PROTIP: fully qualify Ruby version in .rvmrc

March 14, 2012 Ruby RVM

In case you didn’t know (I didn’t), when you write

rvm use 1.9.3

in your .rvmrc, it does not mean “use the installed Ruby, whose version matches 1.9.3”. It means “use the latest Ruby version that RVM knows about that matches 1.9.3”.

So if you have Ruby 1.9.3-p0 installed and you upgrade RVM to a recent release, the .rvmrc will break as RVM will try to use Ruby 1.9.3-p125, which is probably not installed on your system. Happiness ensues when you try to deploy to a server with a different version of RVM.

It’s hard to say that one behavior is better than the other, in my opinion this is your fault (mine, that is).

Morale of the story: use a fully qualified Ruby version string in your .rvmrcs:

rvm use ruby-1.9.3-p0

And of course this will help future you to understand which version of Ruby to install for the project.

Buy Me a Coffee at ko-fi.com