Ruby 2.1.0 went stable a few months ago, and Ruby 1.9.3 support will end in a just over a year.
You know what that means: Warplanes in the sky falling to the ground, dogs and cats getting along like old pals, and people wandering aimlessly through the streets trying to remember the last time they saw a green build.
Believe it or not, all of these things can be prevented. Once upon a time, I wrote about configuring and using rvm to control individual ruby environments for each of your projects. If it’s been a while since you installed your copy of rvm, you might have some trouble installing and using newer version of ruby. Lucky for us, those clever rvm developers made it easy to get around this.
In my case, I want to upgrade a project to use ruby 2.1.0
. The first time I tried to run rvm install ruby-2.1.0
, I ended up installing ruby-2.1.0-preview1
. I realized that I had installed rvm on this machine around October 2013, and ruby 2.1.0
was released in December 2013, so rvm had no idea that ruby 2.1.0
was stable. Updating rvm (in the root of the project directory):
1
|
|
There will be some amount of text on the screen if your system needs to be updated. Note that you must be connected to the internet if you want rvm to update. Now we do the install of our brand new ruby:
1
|
|
Again, text on the screen from fetching of data from the internet. But hopefully you see something that tells you the operation was successful. You can also verify which rubies you have installed using the list
command:
1 2 3 4 5 6 7 8 |
|
Now we tell our current project to use ruby 2.1.0
:
1 2 3 4 5 6 7 8 9 10 |
|
Alright! Crisis averted. If you’re using bundler with this project, be sure to change your ruby version (usually located near the top of the Gemfile
).
What about setting up a new project using ruby 2.1.0
? Easy! Switch to the project directory and:
1
|
|
Oh, rvm, you make life too easy sometimes.