# install RVM
curl -L https://get.rvm.io | bash -s stable
# runs RVM
source /etc/profile.d/rvm.sh
# Setups required files for RVM
rvm requirements --autolibs=enable
- RVM manages your ruby installation
# Install Ruby
rvm install 2.0.0
# Config RVM to use ruby 2.0.0
rvm use 2.0.0
rvm --default 2.0.0
- RVM manages your Gem dependencies by allowing you to install Gems in its own directory
- If your project directory has a
Gemfile
(which just contains a single-line text of your project name), RVM will bundle gems in its directory for that project
- RVM also has a default and global gemset
global: When a gemset is installing a gem, it will first lookup in the global gemset to find if it is already downloaded. Hence, it makes installing faster. It is a good idea to pre-install many gems in your global so your projects starts faster.
default: If a directory does not have a Gemfile, it will automatically use this gemset. (Why would you do this?)
- Be sure to install bundler:
gem install bundler
# Recipe to install gems into gemset
# List all your gemsets
rvm gemset list
# Use the global gemset
rvm gemset use global
# Create your Gemfile and then run bundle install
# Gems are installed into your global gemset
- RVM stores all the gems in
~/.rvm/gems