Reputation: 401
I'm a little confused on using Ruby Version Manager. I was just wondering how to handle ruby updates for my web apps.
For example, I start a new Rails project and I tell RVM to use a specific version of Ruby like so:
rvm use ruby-2.0.0@my-project-name --create
Then say months down the road a new version of Ruby is released. What do I do then? Do I go back in and tell RVM to use the newer version? I want to build something that is always using the latest version of Ruby.
I'm assuming people build Rails apps, but don't always update to the newest version of Ruby and Rails?
Thanks, just starting out with all this, and trying to wrap my head around it.
Upvotes: 0
Views: 70
Reputation: 1951
There are three parts in this, Ruby, Gems and Rails Project, RVM can help organize everything in this order Ruby Interpreter/Version -> Gemset -> Rails Project
First Ruby:
You can use rvm list known
to list all Ruby versions available in MRI, Rubinius, JRuby and others, after that you can install any version and interpreter like:
rvm install 2.1
will install the latest in the 2.1 branch (2.1.1 being the latest).rvm install rbx
will install the latest stable Rubinius.rvm install jruby
will install the latest stable JRuby.After installing the version you're going to use, you need to specify that you're going to use it, like this for Rubinius: rvm rbx
.
Second Gemset:
RVM gives you the ability to define different gemsets in each installed Ruby version that allows you to install gems for a specific project. For this Rubinius version I can:
rvm gemset create latestRails
.rvm rbx@latestRails
.rvm current
.gem install rails
.Third Rails:
To keep Rails updated, you can use Bundler with a command like bundle update
to keep all the gems updated (this are updated inside the current Ruby/gemset and the Gemfile) or a list/single gem of the project, for more info see "Bundle Update Documentation".
I hope I could help you.
Upvotes: 1