Ruby and Rails in 5 Minutes with RVM

Installed Linux on yet another laptop, quick instructions for installing Ruby and Rails in 5 minutes (okay, maybe 10) with RVM.

Basic steps are get RVM installed, download Rubies using RVM, then setup and use .rvmrc gemsets inside your projects.

Here is the Gist to explain it:

# .rvmrc
# Finish downloads required OS prior to installing RVM -- Linux requires curl, bison, autoconf and git before cloning into local repo. Next, download RVM:

$ bash < <(curl -B http://rvm.beginrescueend.com/install/rvm)

# When complete, add this line to the bottom of the .bashrc file located in the /home/<name> directory:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Loads rvm into shell.

# Run test to verify that installation was successful:

$ type rvm | head -1 # Should return 'rvm is a function'

# Install Rubies:

$ rvm install ruby-<version>-<build> # Sample: ruby-1.8.7-p334, can lead off build too.

# Install Rails along with your RVM gemsets -- create .rvmrc system file in your project directory using one line:

rvm use <ruby version>@<gemset> # Sample: 1.8.7-p334@test-app

# Create same gemset named above inside project directory:

$ rvm gemset create <ruby version>@<gemset> # Sample: 1.8.7-p334@test-app

# Begin using newly created gemset:

$ rvm use <ruby version>@<gemset> # Sample: 1.8.7-p334@test-app

# Run bundle install, which installs from Gemfile into gemset -- including Rails

$ bundle install

# These are the general steps, see http://rvm.beginrescueend.com/rvm/install/ with any problems during installation. Result is version of Ruby, Rails and gemsets nicely organized by project using .rvmrc. Repeat the process with .rvmrc, creating and using gemsets with each new project.
view raw .rvmrc This Gist brought to you by GitHub.

Leave a Comment

CommentLuv badge
Performance Optimization WordPress Plugins by W3 EDGE